From 6749aa5b1f56e7204ffdea7daab0217525e220ce Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Tue, 10 Mar 2020 10:30:24 -0700 Subject: [PATCH] feat: move to Typescript code generation (#631) * remove docs/, move v2 to ts * update admin/v2 client, test, system-test * update config * lint & pass unit test * add timeout to 10min for droprange * try 1hr * update synth.py * run synthtool * add comments for synth.py exclude files * rerun synthtool * add tracking issues * feedback --- .github/workflows/ci.yaml | 4 +- .gitignore | 6 +- .jsdoc.js | 32 +- .kokoro/samples-test.sh | 11 - .kokoro/system-test.sh | 12 - .kokoro/test.sh | 11 - package.json | 56 +- protos/google/cloud/common_resources.proto | 52 + protos/protos.d.ts | 7058 +++---- protos/protos.js | 17096 ++++++++-------- protos/protos.json | 402 +- src/service_proto_list.json | 1 - ...{bigtable_client.js => bigtable_client.ts} | 831 +- src/v2/bigtable_client_config.json | 52 +- src/v2/bigtable_instance_admin_client.js | 2160 -- src/v2/bigtable_instance_admin_client.ts | 2315 +++ ...bigtable_instance_admin_client_config.json | 71 +- .../bigtable_instance_admin_proto_list.json | 6 +- src/v2/bigtable_proto_list.json | 3 +- src/v2/bigtable_table_admin_client.js | 1925 -- src/v2/bigtable_table_admin_client.ts | 2160 ++ .../bigtable_table_admin_client_config.json | 100 +- src/v2/bigtable_table_admin_proto_list.json | 6 +- .../admin/v2/doc_bigtable_instance_admin.js | 510 - .../admin/v2/doc_bigtable_table_admin.js | 561 - .../google/bigtable/admin/v2/doc_instance.js | 278 - .../doc/google/bigtable/admin/v2/doc_table.js | 328 - src/v2/doc/google/bigtable/v2/doc_bigtable.js | 435 - src/v2/doc/google/bigtable/v2/doc_data.js | 680 - src/v2/doc/google/iam/v1/doc_iam_policy.js | 96 - src/v2/doc/google/iam/v1/doc_options.js | 37 - src/v2/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - src/v2/doc/google/protobuf/doc_any.js | 137 - src/v2/doc/google/protobuf/doc_duration.js | 97 - src/v2/doc/google/protobuf/doc_empty.js | 34 - src/v2/doc/google/protobuf/doc_field_mask.js | 228 - src/v2/doc/google/protobuf/doc_timestamp.js | 119 - src/v2/doc/google/protobuf/doc_wrappers.js | 48 - src/v2/doc/google/rpc/doc_status.js | 47 - src/v2/doc/google/type/doc_expr.js | 51 - src/v2/index.ts | 21 + synth.metadata | 25 +- synth.py | 61 +- system-test/fixtures/sample/package.json | 23 - .../fixtures/sample/src}/index.js | 19 +- system-test/fixtures/sample/src/index.ts | 13 +- system-test/fixtures/sample/tsconfig.json | 11 - system-test/install.ts | 72 +- test/gapic-bigtable-v2.ts | 455 + test/gapic-bigtable_instance_admin-v2.ts | 1284 ++ test/gapic-bigtable_table_admin-v2.ts | 1010 + test/gapic-v2-admin.ts | 2413 --- test/gapic-v2.js | 2680 --- tsconfig.json | 7 +- webpack.config.js | 64 + 56 files changed, 20342 insertions(+), 26102 deletions(-) create mode 100644 protos/google/cloud/common_resources.proto delete mode 100644 src/service_proto_list.json rename src/v2/{bigtable_client.js => bigtable_client.ts} (54%) delete mode 100644 src/v2/bigtable_instance_admin_client.js create mode 100644 src/v2/bigtable_instance_admin_client.ts delete mode 100644 src/v2/bigtable_table_admin_client.js create mode 100644 src/v2/bigtable_table_admin_client.ts delete mode 100644 src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js delete mode 100644 src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js delete mode 100644 src/v2/doc/google/bigtable/admin/v2/doc_instance.js delete mode 100644 src/v2/doc/google/bigtable/admin/v2/doc_table.js delete mode 100644 src/v2/doc/google/bigtable/v2/doc_bigtable.js delete mode 100644 src/v2/doc/google/bigtable/v2/doc_data.js delete mode 100644 src/v2/doc/google/iam/v1/doc_iam_policy.js delete mode 100644 src/v2/doc/google/iam/v1/doc_options.js delete mode 100644 src/v2/doc/google/iam/v1/doc_policy.js delete mode 100644 src/v2/doc/google/longrunning/doc_operations.js delete mode 100644 src/v2/doc/google/protobuf/doc_any.js delete mode 100644 src/v2/doc/google/protobuf/doc_duration.js delete mode 100644 src/v2/doc/google/protobuf/doc_empty.js delete mode 100644 src/v2/doc/google/protobuf/doc_field_mask.js delete mode 100644 src/v2/doc/google/protobuf/doc_timestamp.js delete mode 100644 src/v2/doc/google/protobuf/doc_wrappers.js delete mode 100644 src/v2/doc/google/rpc/doc_status.js delete mode 100644 src/v2/doc/google/type/doc_expr.js create mode 100644 src/v2/index.ts delete mode 100644 system-test/fixtures/sample/package.json rename {src/v2 => system-test/fixtures/sample/src}/index.js (55%) delete mode 100644 system-test/fixtures/sample/tsconfig.json create mode 100644 test/gapic-bigtable-v2.ts create mode 100644 test/gapic-bigtable_instance_admin-v2.ts create mode 100644 test/gapic-bigtable_table_admin-v2.ts delete mode 100644 test/gapic-v2-admin.ts delete mode 100644 test/gapic-v2.js create mode 100644 webpack.config.js diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c5cbc5540..4d36c57b1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: 13 + node-version: 12 - run: npm install - run: npm test - - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecovorg -a ${{ secrets.CODECOV_API_KEY }} -r $GITHUB_REPOSITORY --pipe + - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe diff --git a/.gitignore b/.gitignore index c26df5fff..5d32b2378 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ -.vscode +out/ +build/ system-test/secrets.js system-test/*key.json *.lock +.DS_Store package-lock.json -build/ __pycache__ diff --git a/.jsdoc.js b/.jsdoc.js index 9ede3baad..d52a0bc69 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -1,18 +1,20 @@ -/*! - * Copyright 2019 Google LLC. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 86e83c9d3..20e3241c9 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -39,17 +39,6 @@ if [ -f samples/package.json ]; then npm link ../ npm install cd .. - # If tests are running against master, configure Build Cop - # to open issues on failures: - if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then - export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml - export MOCHA_REPORTER=xunit - cleanup() { - chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop - $KOKORO_GFILE_DIR/linux_amd64/buildcop - } - trap cleanup EXIT HUP - fi npm run samples-test fi diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index dfae142a2..fc5824e66 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -33,18 +33,6 @@ fi npm install -# If tests are running against master, configure Build Cop -# to open issues on failures: -if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then - export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml - export MOCHA_REPORTER=xunit - cleanup() { - chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop - $KOKORO_GFILE_DIR/linux_amd64/buildcop - } - trap cleanup EXIT HUP -fi - npm run system-test # codecov combines coverage across integration and unit tests. Include diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 8d9c29545..9db11bb09 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -21,17 +21,6 @@ export NPM_CONFIG_PREFIX=/home/node/.npm-global cd $(dirname $0)/.. npm install -# If tests are running against master, configure Build Cop -# to open issues on failures: -if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then - export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml - export MOCHA_REPORTER=xunit - cleanup() { - chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop - $KOKORO_GFILE_DIR/linux_amd64/buildcop - } - trap cleanup EXIT HUP -fi npm test # codecov combines coverage across integration and unit tests. Include diff --git a/package.json b/package.json index df298fa3c..77a02f303 100644 --- a/package.json +++ b/package.json @@ -17,35 +17,34 @@ "repository": "googleapis/nodejs-bigtable", "license": "Apache-2.0", "author": "Google Inc.", + "main": "build/src/index.js", "files": [ "build/proto", "build/protos", - "build/proto", "build/src", "!**/*.map" ], - "main": "build/src/index.js", - "types": "build/src/index.d.ts", "scripts": { "check": "gts check", "clean": "gts clean", - "compile": "tsc -p . && cp -r src/v2 build/src/ && cp -r proto* build/ && cp test/*.js build/test", + "compile": "tsc -p . && cp -r proto* build/", + "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", "predocs-test": "npm run docs", "docs-test": "linkinator docs", - "fix": "gts fix && npm run lintfix", - "lint": "eslint '**/*.js'", + "fix": "gts fix && eslint '**/*.js' --fix", + "prelint": "cd samples; npm link ../; npm i", + "lint": "gts fix && eslint samples/*.js", "lintfix": "eslint --fix '**/*.js'", "prepare": "npm run compile", "proto": "mkdirp proto && pbjs -t static-module -w commonjs -p protos -p node_modules/google-gax/protos google/protobuf/wrappers.proto google/bigtable/v2/bigtable.proto google/bigtable/admin/v2/bigtable_instance_admin.proto google/bigtable/admin/v2/bigtable_table_admin.proto google/bigtable/v2/data.proto | pbts -o proto/bigtable.d.ts -", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "snippet-test": "mocha samples/document-snippets/tests/*.js --timeout 600000", "presystem-test": "npm run compile", "system-test": "mocha build/system-test --timeout 600000", "pretest": "npm run compile", "test": "c8 mocha build/test", - "posttest": "npm run check", - "prelint": "cd samples; npm link ../; npm i" + "posttest": "npm run check" }, "dependencies": { "@google-cloud/common": "^2.2.2", @@ -57,7 +56,7 @@ "dot-prop": "^5.0.0", "escape-string-regexp": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^1.7.5", + "google-gax": "^1.14.2", "is": "^3.0.1", "is-utf8": "^0.2.1", "lodash.snakecase": "^4.1.1", @@ -73,35 +72,42 @@ "@types/extend": "^3.0.1", "@types/is": "0.0.21", "@types/lodash.snakecase": "^4.1.5", - "@types/mocha": "^7.0.0", + "@types/mocha": "^7.0.2", "@types/mv": "^2.1.0", "@types/ncp": "^2.0.1", + "@types/node": "^13.7.7", "@types/proxyquire": "^1.3.28", "@types/pumpify": "^1.4.1", "@types/sinon": "^7.0.7", "@types/through2": "^2.0.34", "@types/uuid": "^7.0.0", - "codecov": "^3.0.0", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", + "c8": "^7.1.0", + "codecov": "^3.6.5", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "gts": "^1.0.0", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", - "linkinator": "^2.0.0", + "eslint-plugin-prettier": "^3.1.2", + "gts": "^1.1.2", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.3", "mkdirp": "^1.0.0", - "mocha": "^7.0.0", + "mocha": "^7.1.0", "mv": "^2.1.1", "npc": "0.0.1", - "c8": "^7.0.0", + "null-loader": "^3.0.0", "p-queue": "^6.0.2", - "prettier": "^1.7.4", + "pack-n-play": "^1.0.0-2", + "power-assert": "^1.6.1", + "prettier": "^1.19.1", "proxyquire": "^2.0.0", "sinon": "^9.0.0", - "typescript": "3.6.4", - "uuid": "^7.0.0" + "ts-loader": "^6.2.1", + "typescript": "^3.7.0", + "uuid": "^7.0.0", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=8.10.0" diff --git a/protos/google/cloud/common_resources.proto b/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000..56c9f800d --- /dev/null +++ b/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 960cdea2b..f55595a3e 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -26,6324 +26,6324 @@ export namespace google { /** Namespace v2. */ namespace v2 { - /** Properties of a Table. */ - interface ITable { + /** Represents a BigtableInstanceAdmin */ + class BigtableInstanceAdmin extends $protobuf.rpc.Service { - /** Table name */ - name?: (string|null); + /** + * 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); - /** Table clusterStates */ - clusterStates?: ({ [k: string]: google.bigtable.admin.v2.Table.IClusterState }|null); + /** + * 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; - /** Table columnFamilies */ - columnFamilies?: ({ [k: string]: google.bigtable.admin.v2.IColumnFamily }|null); + /** + * 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; - /** Table granularity */ - granularity?: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity|null); - } + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest): Promise; - /** Represents a Table. */ - class Table implements ITable { + /** + * 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; /** - * Constructs a new Table. - * @param [properties] Properties to set + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise */ - constructor(properties?: google.bigtable.admin.v2.ITable); + public getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest): Promise; - /** Table name. */ - public name: string; + /** + * 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; - /** Table clusterStates. */ - public clusterStates: { [k: string]: google.bigtable.admin.v2.Table.IClusterState }; + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest): Promise; - /** Table columnFamilies. */ - public columnFamilies: { [k: string]: google.bigtable.admin.v2.IColumnFamily }; + /** + * 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; - /** Table granularity. */ - public granularity: (google.bigtable.admin.v2.Table.TimestampGranularity|keyof typeof google.bigtable.admin.v2.Table.TimestampGranularity); + /** + * Calls UpdateInstance. + * @param request Instance message or plain object + * @returns Promise + */ + public updateInstance(request: google.bigtable.admin.v2.IInstance): Promise; /** - * Creates a new Table instance using the specified properties. - * @param [properties] Properties to set - * @returns Table instance + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static create(properties?: google.bigtable.admin.v2.ITable): google.bigtable.admin.v2.Table; + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback): void; /** - * 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 + * Calls PartialUpdateInstance. + * @param request PartialUpdateInstanceRequest message or plain object + * @returns Promise */ - public static encode(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): Promise; /** - * 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 + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encodeDelimited(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback): void; /** - * 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 + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table; + public deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest): Promise; /** - * 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 + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table; + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback): void; /** - * Verifies a Table message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest): Promise; /** - * Creates a Table message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Table + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table; + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback): void; /** - * 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 + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise */ - public static toObject(message: google.bigtable.admin.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest): Promise; /** - * Converts this Table to JSON. - * @returns JSON object + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse */ - public toJSON(): { [k: string]: any }; - } + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback): void; - namespace Table { + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.bigtable.admin.v2.IListClustersRequest): Promise; - /** Properties of a ClusterState. */ - interface IClusterState { + /** + * 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; - /** ClusterState replicationState */ - replicationState?: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null); - } + /** + * Calls UpdateCluster. + * @param request Cluster message or plain object + * @returns Promise + */ + public updateCluster(request: google.bigtable.admin.v2.ICluster): Promise; - /** Represents a ClusterState. */ - class ClusterState implements IClusterState { + /** + * 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; - /** - * Constructs a new ClusterState. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.Table.IClusterState); + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest): Promise; - /** ClusterState replicationState. */ - public replicationState: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState); + /** + * 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; - /** - * 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; + /** + * Calls CreateAppProfile. + * @param request CreateAppProfileRequest message or plain object + * @returns Promise + */ + public createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest): Promise; - /** - * 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; + /** + * 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; - /** - * 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 }; - } - - namespace ClusterState { - - /** ReplicationState enum. */ - enum ReplicationState { - STATE_NOT_KNOWN = 0, - INITIALIZING = 1, - PLANNED_MAINTENANCE = 2, - UNPLANNED_MAINTENANCE = 3, - READY = 4 - } - } - - /** 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, - FULL = 4 - } - } - - /** Properties of a ColumnFamily. */ - interface IColumnFamily { - - /** ColumnFamily gcRule */ - gcRule?: (google.bigtable.admin.v2.IGcRule|null); - } - - /** Represents a ColumnFamily. */ - class ColumnFamily implements IColumnFamily { + /** + * Calls GetAppProfile. + * @param request GetAppProfileRequest message or plain object + * @returns Promise + */ + public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest): Promise; /** - * Constructs a new ColumnFamily. - * @param [properties] Properties to set + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppProfilesResponse */ - constructor(properties?: google.bigtable.admin.v2.IColumnFamily); - - /** ColumnFamily gcRule. */ - public gcRule?: (google.bigtable.admin.v2.IGcRule|null); + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback): void; /** - * Creates a new ColumnFamily instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnFamily instance + * Calls ListAppProfiles. + * @param request ListAppProfilesRequest message or plain object + * @returns Promise */ - public static create(properties?: google.bigtable.admin.v2.IColumnFamily): google.bigtable.admin.v2.ColumnFamily; + public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest): Promise; /** - * 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 + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback): void; /** - * 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 + * Calls UpdateAppProfile. + * @param request UpdateAppProfileRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest): Promise; /** - * 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 + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ColumnFamily; + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback): void; /** - * 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 + * Calls DeleteAppProfile. + * @param request DeleteAppProfileRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ColumnFamily; + public deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest): Promise; /** - * Verifies a ColumnFamily message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static verify(message: { [k: string]: any }): (string|null); + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback): void; /** - * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnFamily + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ColumnFamily; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; /** - * 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 + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static toObject(message: google.bigtable.admin.v2.ColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback): void; /** - * Converts this ColumnFamily to JSON. - * @returns JSON object + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GcRule. */ - interface IGcRule { - - /** GcRule maxNumVersions */ - maxNumVersions?: (number|null); - - /** GcRule maxAge */ - maxAge?: (google.protobuf.IDuration|null); + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - /** GcRule intersection */ - intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + /** + * 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; - /** GcRule union */ - union?: (google.bigtable.admin.v2.GcRule.IUnion|null); + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; } - /** Represents a GcRule. */ - class GcRule implements IGcRule { + namespace BigtableInstanceAdmin { /** - * Constructs a new GcRule. - * @param [properties] Properties to set + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#createInstance}. + * @param error Error, if any + * @param [response] Operation */ - constructor(properties?: google.bigtable.admin.v2.IGcRule); - - /** GcRule maxNumVersions. */ - public maxNumVersions: number; - - /** 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"); + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a new GcRule instance using the specified properties. - * @param [properties] Properties to set - * @returns GcRule instance + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getInstance}. + * @param error Error, if any + * @param [response] Instance */ - public static create(properties?: google.bigtable.admin.v2.IGcRule): google.bigtable.admin.v2.GcRule; + type GetInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse */ - public static encode(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + type ListInstancesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListInstancesResponse) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#updateInstance}. + * @param error Error, if any + * @param [response] Instance */ - public static encodeDelimited(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#partialUpdateInstance}. + * @param error Error, if any + * @param [response] Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule; + type PartialUpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#deleteInstance}. + * @param error Error, if any + * @param [response] Empty */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule; + type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Verifies a GcRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#createCluster}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a GcRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcRule + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getCluster}. + * @param error Error, if any + * @param [response] Cluster */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule; + type GetClusterCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Cluster) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse */ - public static toObject(message: google.bigtable.admin.v2.GcRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ListClustersCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListClustersResponse) => void; /** - * Converts this GcRule to JSON. - * @returns JSON object + * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#updateCluster}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; - } - - namespace GcRule { + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** Properties of an Intersection. */ - interface IIntersection { + /** + * 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; - /** Intersection rules */ - rules?: (google.bigtable.admin.v2.IGcRule[]|null); - } + /** + * 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; - /** Represents an Intersection. */ - class Intersection implements IIntersection { + /** + * 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; - /** - * Constructs a new Intersection. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.GcRule.IIntersection); + /** + * 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; - /** Intersection rules. */ - public rules: google.bigtable.admin.v2.IGcRule[]; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; + } - /** - * 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; + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { - /** - * 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); + /** CreateInstanceRequest parent */ + parent?: (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; + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); - /** - * 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 }; + /** CreateInstanceRequest instance */ + instance?: (google.bigtable.admin.v2.IInstance|null); - /** - * Converts this Intersection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** CreateInstanceRequest clusters */ + clusters?: ({ [k: string]: google.bigtable.admin.v2.ICluster }|null); + } - /** Properties of an Union. */ - interface IUnion { + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { - /** Union rules */ - rules?: (google.bigtable.admin.v2.IGcRule[]|null); - } + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceRequest); - /** Represents an Union. */ - class Union implements IUnion { + /** CreateInstanceRequest parent. */ + public parent: string; - /** - * Constructs a new Union. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.GcRule.IUnion); + /** CreateInstanceRequest instanceId. */ + public instanceId: string; - /** Union rules. */ - public rules: google.bigtable.admin.v2.IGcRule[]; + /** CreateInstanceRequest instance. */ + public instance?: (google.bigtable.admin.v2.IInstance|null); - /** - * 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; + /** CreateInstanceRequest clusters. */ + public clusters: { [k: string]: google.bigtable.admin.v2.ICluster }; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this Union to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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 }; } - /** Properties of a Snapshot. */ - interface ISnapshot { + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { - /** Snapshot name */ + /** GetInstanceRequest 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 { + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { /** - * Constructs a new Snapshot. + * Constructs a new GetInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ISnapshot); + constructor(properties?: google.bigtable.admin.v2.IGetInstanceRequest); - /** Snapshot name. */ + /** GetInstanceRequest 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. + * Creates a new GetInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Snapshot instance + * @returns GetInstanceRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ISnapshot): google.bigtable.admin.v2.Snapshot; + public static create(properties?: google.bigtable.admin.v2.IGetInstanceRequest): google.bigtable.admin.v2.GetInstanceRequest; /** - * 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 + * 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.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGetInstanceRequest, 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 + * 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.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Snapshot message from the specified reader or buffer. + * 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 Snapshot + * @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.Snapshot; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetInstanceRequest; /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Snapshot + * @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.Snapshot; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetInstanceRequest; /** - * Verifies a Snapshot message. + * 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 Snapshot message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Snapshot + * @returns GetInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Snapshot; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetInstanceRequest; /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @param message Snapshot + * 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.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Snapshot to JSON. + * Converts this GetInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Snapshot { + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { - /** State enum. */ - enum State { - STATE_NOT_KNOWN = 0, - READY = 1, - CREATING = 2 - } - } + /** ListInstancesRequest parent */ + parent?: (string|null); - /** StorageType enum. */ - enum StorageType { - STORAGE_TYPE_UNSPECIFIED = 0, - SSD = 1, - HDD = 2 + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a BigtableInstanceAdmin */ - class BigtableInstanceAdmin extends $protobuf.rpc.Service { + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { /** - * 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 + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.bigtable.admin.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; /** - * 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. + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): BigtableInstanceAdmin; + public static create(properties?: google.bigtable.admin.v2.IListInstancesRequest): google.bigtable.admin.v2.ListInstancesRequest; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * 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 createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstanceCallback): void; + public static encode(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise + * 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 createInstance(request: google.bigtable.admin.v2.ICreateInstanceRequest): Promise; + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance + * 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 getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstanceCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesRequest; /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise + * 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 getInstance(request: google.bigtable.admin.v2.IGetInstanceRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesRequest; /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstancesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest */ - public listInstances(request: google.bigtable.admin.v2.IListInstancesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesRequest; /** - * Calls UpdateInstance. - * @param request Instance message or plain object - * @param callback Node-style callback called with the error, if any, and Instance + * 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 updateInstance(request: google.bigtable.admin.v2.IInstance, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstanceCallback): void; + public static toObject(message: google.bigtable.admin.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateInstance. - * @param request Instance message or plain object - * @returns Promise + * Converts this ListInstancesRequest to JSON. + * @returns JSON object */ - public updateInstance(request: google.bigtable.admin.v2.IInstance): Promise; + public toJSON(): { [k: string]: any }; + } + + /** 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 { /** - * Calls PartialUpdateInstance. - * @param request PartialUpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set */ - public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstanceCallback): void; + 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; /** - * Calls PartialUpdateInstance. - * @param request PartialUpdateInstanceRequest message or plain object - * @returns Promise + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance */ - public partialUpdateInstance(request: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): Promise; + public static create(properties?: google.bigtable.admin.v2.IListInstancesResponse): google.bigtable.admin.v2.ListInstancesResponse; /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstanceCallback): void; + public static encode(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise + * 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 deleteInstance(request: google.bigtable.admin.v2.IDeleteInstanceRequest): Promise; + public static encodeDelimited(message: google.bigtable.admin.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * 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 createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateClusterCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListInstancesResponse; /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise + * 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 createCluster(request: google.bigtable.admin.v2.ICreateClusterRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListInstancesResponse; /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetClusterCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse */ - public getCluster(request: google.bigtable.admin.v2.IGetClusterRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesResponse; /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse + * 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 listClusters(request: google.bigtable.admin.v2.IListClustersRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListClustersCallback): void; + public static toObject(message: google.bigtable.admin.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise + * Converts this ListInstancesResponse to JSON. + * @returns JSON object */ - public listClusters(request: google.bigtable.admin.v2.IListClustersRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** 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 { /** - * Calls UpdateCluster. - * @param request Cluster message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new PartialUpdateInstanceRequest. + * @param [properties] Properties to set */ - public updateCluster(request: google.bigtable.admin.v2.ICluster, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateClusterCallback): void; + 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); /** - * Calls UpdateCluster. - * @param request Cluster message or plain object - * @returns Promise + * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialUpdateInstanceRequest instance */ - public updateCluster(request: google.bigtable.admin.v2.ICluster): Promise; + public static create(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): google.bigtable.admin.v2.PartialUpdateInstanceRequest; /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteClusterCallback): void; + public static encode(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise + * 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 deleteCluster(request: google.bigtable.admin.v2.IDeleteClusterRequest): Promise; + public static encodeDelimited(message: google.bigtable.admin.v2.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateAppProfile. - * @param request CreateAppProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppProfile + * 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 createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfileCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.PartialUpdateInstanceRequest; /** - * Calls CreateAppProfile. - * @param request CreateAppProfileRequest message or plain object - * @returns Promise + * 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 createAppProfile(request: google.bigtable.admin.v2.ICreateAppProfileRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.PartialUpdateInstanceRequest; /** - * Calls GetAppProfile. - * @param request GetAppProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppProfile + * Verifies a PartialUpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfileCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetAppProfile. - * @param request GetAppProfileRequest message or plain object - * @returns Promise + * Creates a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialUpdateInstanceRequest */ - public getAppProfile(request: google.bigtable.admin.v2.IGetAppProfileRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateInstanceRequest; /** - * Calls ListAppProfiles. - * @param request ListAppProfilesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAppProfilesResponse + * 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 listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfilesCallback): void; + public static toObject(message: google.bigtable.admin.v2.PartialUpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListAppProfiles. - * @param request ListAppProfilesRequest message or plain object - * @returns Promise + * Converts this PartialUpdateInstanceRequest to JSON. + * @returns JSON object */ - public listAppProfiles(request: google.bigtable.admin.v2.IListAppProfilesRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { /** - * Calls UpdateAppProfile. - * @param request UpdateAppProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set */ - public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfileCallback): void; + constructor(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; /** - * Calls UpdateAppProfile. - * @param request UpdateAppProfileRequest message or plain object - * @returns Promise + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance */ - public updateAppProfile(request: google.bigtable.admin.v2.IUpdateAppProfileRequest): Promise; + public static create(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest): google.bigtable.admin.v2.DeleteInstanceRequest; /** - * Calls DeleteAppProfile. - * @param request DeleteAppProfileRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfileCallback): void; + public static encode(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteAppProfile. - * @param request DeleteAppProfileRequest message or plain object - * @returns Promise + * 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 deleteAppProfile(request: google.bigtable.admin.v2.IDeleteAppProfileRequest): Promise; + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * 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 getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicyCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteInstanceRequest; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise + * 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 getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteInstanceRequest; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicyCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteInstanceRequest; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * 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 testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissionsCallback): void; + public static toObject(message: google.bigtable.admin.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace BigtableInstanceAdmin { + /** 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 { /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#createInstance}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + 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); /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getInstance}. - * @param error Error, if any - * @param [response] Instance + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance */ - type GetInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + public static create(properties?: google.bigtable.admin.v2.ICreateClusterRequest): google.bigtable.admin.v2.CreateClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse + * 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 */ - type ListInstancesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListInstancesResponse) => void; + public static encode(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#updateInstance}. - * @param error Error, if any - * @param [response] Instance + * 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 */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Instance) => void; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#partialUpdateInstance}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type PartialUpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#deleteInstance}. - * @param error Error, if any - * @param [response] Empty + * 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 */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#createCluster}. - * @param error Error, if any - * @param [response] Operation + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getCluster}. - * @param error Error, if any - * @param [response] Cluster + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest */ - type GetClusterCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Cluster) => void; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse + * 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 */ - type ListClustersCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListClustersResponse) => void; + public static toObject(message: google.bigtable.admin.v2.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#updateCluster}. - * @param error Error, if any - * @param [response] Operation + * Converts this CreateClusterRequest to JSON. + * @returns JSON object */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#deleteCluster}. - * @param error Error, if any - * @param [response] Empty + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set */ - type DeleteClusterCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + constructor(properties?: google.bigtable.admin.v2.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#createAppProfile}. - * @param error Error, if any - * @param [response] AppProfile + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance */ - type CreateAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + public static create(properties?: google.bigtable.admin.v2.IGetClusterRequest): google.bigtable.admin.v2.GetClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getAppProfile}. - * @param error Error, if any - * @param [response] AppProfile + * 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 */ - type GetAppProfileCallback = (error: (Error|null), response?: google.bigtable.admin.v2.AppProfile) => void; + public static encode(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#listAppProfiles}. - * @param error Error, if any - * @param [response] ListAppProfilesResponse + * 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 */ - type ListAppProfilesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListAppProfilesResponse) => void; + public static encodeDelimited(message: google.bigtable.admin.v2.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#updateAppProfile}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type UpdateAppProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#deleteAppProfile}. - * @param error Error, if any - * @param [response] Empty + * 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 */ - type DeleteAppProfileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetClusterRequest; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableInstanceAdmin#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse + * 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 */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + 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 }; } - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { - /** CreateInstanceRequest parent */ + /** ListClustersRequest 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); + /** ListClustersRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { /** - * Constructs a new CreateInstanceRequest. + * Constructs a new ListClustersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateInstanceRequest); + constructor(properties?: google.bigtable.admin.v2.IListClustersRequest); - /** CreateInstanceRequest parent. */ + /** ListClustersRequest 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 }; + /** ListClustersRequest pageToken. */ + public pageToken: string; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new ListClustersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequest instance + * @returns ListClustersRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateInstanceRequest): google.bigtable.admin.v2.CreateInstanceRequest; + public static create(properties?: google.bigtable.admin.v2.IListClustersRequest): google.bigtable.admin.v2.ListClustersRequest; /** - * 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 + * 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.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListClustersRequest, 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 + * 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.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * 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 CreateInstanceRequest + * @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.CreateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersRequest; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest + * @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.CreateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersRequest; /** - * Verifies a CreateInstanceRequest message. + * 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 CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceRequest + * @returns ListClustersRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersRequest; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest + * 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.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this ListClustersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { - /** GetInstanceRequest name */ - name?: (string|null); + /** ListClustersResponse clusters */ + clusters?: (google.bigtable.admin.v2.ICluster[]|null); + + /** ListClustersResponse failedLocations */ + failedLocations?: (string[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { /** - * Constructs a new GetInstanceRequest. + * Constructs a new ListClustersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGetInstanceRequest); + constructor(properties?: google.bigtable.admin.v2.IListClustersResponse); - /** GetInstanceRequest name. */ - public name: string; + /** ListClustersResponse clusters. */ + public clusters: google.bigtable.admin.v2.ICluster[]; + + /** ListClustersResponse failedLocations. */ + public failedLocations: string[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new ListClustersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetInstanceRequest instance + * @returns ListClustersResponse instance */ - public static create(properties?: google.bigtable.admin.v2.IGetInstanceRequest): google.bigtable.admin.v2.GetInstanceRequest; + public static create(properties?: google.bigtable.admin.v2.IListClustersResponse): google.bigtable.admin.v2.ListClustersResponse; /** - * 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 + * 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.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListClustersResponse, 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 + * 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.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * 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 GetInstanceRequest + * @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.GetInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListClustersResponse; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest + * @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.GetInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListClustersResponse; /** - * Verifies a GetInstanceRequest message. + * 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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetInstanceRequest + * @returns ListClustersResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersResponse; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest + * 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.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this ListClustersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); + /** DeleteClusterRequest name */ + name?: (string|null); } - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { /** - * Constructs a new ListInstancesRequest. + * Constructs a new DeleteClusterRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; + constructor(properties?: google.bigtable.admin.v2.IDeleteClusterRequest); - /** ListInstancesRequest pageToken. */ - public pageToken: string; + /** DeleteClusterRequest name. */ + public name: string; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new DeleteClusterRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesRequest instance + * @returns DeleteClusterRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IListInstancesRequest): google.bigtable.admin.v2.ListInstancesRequest; + public static create(properties?: google.bigtable.admin.v2.IDeleteClusterRequest): google.bigtable.admin.v2.DeleteClusterRequest; /** - * 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 + * 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.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IDeleteClusterRequest, 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 + * 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.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * 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 ListInstancesRequest + * @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.ListInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteClusterRequest; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest + * @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.ListInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteClusterRequest; /** - * Verifies a ListInstancesRequest message. + * 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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesRequest + * @returns DeleteClusterRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteClusterRequest; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest + * 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.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this DeleteClusterRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { + /** Properties of a CreateInstanceMetadata. */ + interface ICreateInstanceMetadata { - /** ListInstancesResponse instances */ - instances?: (google.bigtable.admin.v2.IInstance[]|null); + /** CreateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); - /** ListInstancesResponse failedLocations */ - failedLocations?: (string[]|null); + /** CreateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); } - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { + /** Represents a CreateInstanceMetadata. */ + class CreateInstanceMetadata implements ICreateInstanceMetadata { /** - * Constructs a new ListInstancesResponse. + * Constructs a new CreateInstanceMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListInstancesResponse); + constructor(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata); - /** ListInstancesResponse instances. */ - public instances: google.bigtable.admin.v2.IInstance[]; + /** CreateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); - /** ListInstancesResponse failedLocations. */ - public failedLocations: string[]; + /** CreateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; + /** CreateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new CreateInstanceMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesResponse instance + * @returns CreateInstanceMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.IListInstancesResponse): google.bigtable.admin.v2.ListInstancesResponse; + public static create(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata): google.bigtable.admin.v2.CreateInstanceMetadata; /** - * 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 + * 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.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICreateInstanceMetadata, 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 + * 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.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * 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 ListInstancesResponse + * @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.ListInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateInstanceMetadata; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse + * @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.ListInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateInstanceMetadata; /** - * Verifies a ListInstancesResponse message. + * 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesResponse + * @returns CreateInstanceMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceMetadata; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse + * 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.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this CreateInstanceMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PartialUpdateInstanceRequest. */ - interface IPartialUpdateInstanceRequest { + /** Properties of an UpdateInstanceMetadata. */ + interface IUpdateInstanceMetadata { - /** PartialUpdateInstanceRequest instance */ - instance?: (google.bigtable.admin.v2.IInstance|null); + /** UpdateInstanceMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); - /** PartialUpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** UpdateInstanceMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); } - /** Represents a PartialUpdateInstanceRequest. */ - class PartialUpdateInstanceRequest implements IPartialUpdateInstanceRequest { + /** Represents an UpdateInstanceMetadata. */ + class UpdateInstanceMetadata implements IUpdateInstanceMetadata { /** - * Constructs a new PartialUpdateInstanceRequest. + * Constructs a new UpdateInstanceMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest); + constructor(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata); - /** PartialUpdateInstanceRequest instance. */ - public instance?: (google.bigtable.admin.v2.IInstance|null); + /** UpdateInstanceMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); - /** PartialUpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** UpdateInstanceMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * Creates a new UpdateInstanceMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PartialUpdateInstanceRequest instance + * @returns UpdateInstanceMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.IPartialUpdateInstanceRequest): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + public static create(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata): google.bigtable.admin.v2.UpdateInstanceMetadata; /** - * 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 + * 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.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, 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 + * 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.IPartialUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * 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 PartialUpdateInstanceRequest + * @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.PartialUpdateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateInstanceMetadata; /** - * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PartialUpdateInstanceRequest + * @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.PartialUpdateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateInstanceMetadata; /** - * Verifies a PartialUpdateInstanceRequest message. + * 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 a PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PartialUpdateInstanceRequest + * @returns UpdateInstanceMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.PartialUpdateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateInstanceMetadata; /** - * Creates a plain object from a PartialUpdateInstanceRequest message. Also converts values to other types if specified. - * @param message PartialUpdateInstanceRequest + * 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.PartialUpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PartialUpdateInstanceRequest to JSON. + * Converts this UpdateInstanceMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { + /** Properties of a CreateClusterMetadata. */ + interface ICreateClusterMetadata { - /** DeleteInstanceRequest name */ - name?: (string|null); + /** CreateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICreateClusterRequest|null); + + /** CreateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { + /** Represents a CreateClusterMetadata. */ + class CreateClusterMetadata implements ICreateClusterMetadata { /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new CreateClusterMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest); + constructor(properties?: google.bigtable.admin.v2.ICreateClusterMetadata); - /** DeleteInstanceRequest name. */ - public name: string; + /** 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); /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new CreateClusterMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance + * @returns CreateClusterMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.IDeleteInstanceRequest): google.bigtable.admin.v2.DeleteInstanceRequest; + public static create(properties?: google.bigtable.admin.v2.ICreateClusterMetadata): google.bigtable.admin.v2.CreateClusterMetadata; /** - * 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 + * 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.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICreateClusterMetadata, 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 + * 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.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * 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 DeleteInstanceRequest + * @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.DeleteInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest + * @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.DeleteInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata; /** - * Verifies a DeleteInstanceRequest message. + * 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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteInstanceRequest + * @returns CreateClusterMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest + * 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.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this CreateClusterMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { + /** Properties of an UpdateClusterMetadata. */ + interface IUpdateClusterMetadata { - /** CreateClusterRequest parent */ - parent?: (string|null); + /** UpdateClusterMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ICluster|null); - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); + /** UpdateClusterMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); - /** CreateClusterRequest cluster */ - cluster?: (google.bigtable.admin.v2.ICluster|null); + /** UpdateClusterMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { + /** Represents an UpdateClusterMetadata. */ + class UpdateClusterMetadata implements IUpdateClusterMetadata { /** - * Constructs a new CreateClusterRequest. + * Constructs a new UpdateClusterMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateClusterRequest); + constructor(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata); - /** CreateClusterRequest parent. */ - public parent: string; + /** UpdateClusterMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ICluster|null); - /** CreateClusterRequest clusterId. */ - public clusterId: string; + /** UpdateClusterMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); - /** CreateClusterRequest cluster. */ - public cluster?: (google.bigtable.admin.v2.ICluster|null); + /** UpdateClusterMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new UpdateClusterMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateClusterRequest instance + * @returns UpdateClusterMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateClusterRequest): google.bigtable.admin.v2.CreateClusterRequest; + public static create(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata): google.bigtable.admin.v2.UpdateClusterMetadata; /** - * 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 + * 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.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IUpdateClusterMetadata, 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 + * 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.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * 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 CreateClusterRequest + * @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.CreateClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateClusterMetadata; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest + * @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.CreateClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateClusterMetadata; /** - * Verifies a CreateClusterRequest message. + * 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 a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateClusterRequest + * @returns UpdateClusterMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateClusterMetadata; /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest + * 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.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.UpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateClusterRequest to JSON. + * Converts this UpdateClusterMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { + /** Properties of a CreateAppProfileRequest. */ + interface ICreateAppProfileRequest { - /** GetClusterRequest name */ - name?: (string|null); + /** 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 GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { + /** Represents a CreateAppProfileRequest. */ + class CreateAppProfileRequest implements ICreateAppProfileRequest { /** - * Constructs a new GetClusterRequest. + * Constructs a new CreateAppProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGetClusterRequest); + constructor(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest); - /** GetClusterRequest name. */ - public name: string; + /** 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 GetClusterRequest instance using the specified properties. + * Creates a new CreateAppProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetClusterRequest instance + * @returns CreateAppProfileRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IGetClusterRequest): google.bigtable.admin.v2.GetClusterRequest; + public static create(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest): google.bigtable.admin.v2.CreateAppProfileRequest; /** - * 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 + * 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.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICreateAppProfileRequest, 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 + * 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.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * 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 GetClusterRequest + * @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.GetClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateAppProfileRequest; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetClusterRequest + * @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.GetClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateAppProfileRequest; /** - * Verifies a GetClusterRequest message. + * 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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetClusterRequest + * @returns CreateAppProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetClusterRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAppProfileRequest; /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest + * 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.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetClusterRequest to JSON. + * Converts this CreateAppProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest parent */ - parent?: (string|null); + /** Properties of a GetAppProfileRequest. */ + interface IGetAppProfileRequest { - /** ListClustersRequest pageToken */ - pageToken?: (string|null); + /** GetAppProfileRequest name */ + name?: (string|null); } - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { + /** Represents a GetAppProfileRequest. */ + class GetAppProfileRequest implements IGetAppProfileRequest { /** - * Constructs a new ListClustersRequest. + * Constructs a new GetAppProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListClustersRequest); - - /** ListClustersRequest parent. */ - public parent: string; + constructor(properties?: google.bigtable.admin.v2.IGetAppProfileRequest); - /** ListClustersRequest pageToken. */ - public pageToken: string; + /** GetAppProfileRequest name. */ + public name: string; /** - * Creates a new ListClustersRequest instance using the specified properties. + * Creates a new GetAppProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersRequest instance + * @returns GetAppProfileRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IListClustersRequest): google.bigtable.admin.v2.ListClustersRequest; + public static create(properties?: google.bigtable.admin.v2.IGetAppProfileRequest): google.bigtable.admin.v2.GetAppProfileRequest; /** - * 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 + * 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.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGetAppProfileRequest, 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 + * 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.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * 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 ListClustersRequest + * @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.ListClustersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetAppProfileRequest; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersRequest + * @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.ListClustersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetAppProfileRequest; /** - * Verifies a ListClustersRequest message. + * 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 ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersRequest + * @returns GetAppProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAppProfileRequest; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest + * 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.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GetAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersRequest to JSON. + * Converts this GetAppProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { + /** Properties of a ListAppProfilesRequest. */ + interface IListAppProfilesRequest { - /** ListClustersResponse clusters */ - clusters?: (google.bigtable.admin.v2.ICluster[]|null); + /** ListAppProfilesRequest parent */ + parent?: (string|null); - /** ListClustersResponse failedLocations */ - failedLocations?: (string[]|null); + /** ListAppProfilesRequest pageSize */ + pageSize?: (number|null); - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); + /** ListAppProfilesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { + /** Represents a ListAppProfilesRequest. */ + class ListAppProfilesRequest implements IListAppProfilesRequest { /** - * Constructs a new ListClustersResponse. + * Constructs a new ListAppProfilesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListClustersResponse); + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesRequest); - /** ListClustersResponse clusters. */ - public clusters: google.bigtable.admin.v2.ICluster[]; + /** ListAppProfilesRequest parent. */ + public parent: string; - /** ListClustersResponse failedLocations. */ - public failedLocations: string[]; + /** ListAppProfilesRequest pageSize. */ + public pageSize: number; - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; + /** ListAppProfilesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ListClustersResponse instance using the specified properties. + * Creates a new ListAppProfilesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersResponse instance + * @returns ListAppProfilesRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IListClustersResponse): google.bigtable.admin.v2.ListClustersResponse; + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesRequest): google.bigtable.admin.v2.ListAppProfilesRequest; /** - * 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 + * 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.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListAppProfilesRequest, 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 + * 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.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * 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 ListClustersResponse + * @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.ListClustersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesRequest; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersResponse + * @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.ListClustersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesRequest; /** - * Verifies a ListClustersResponse message. + * 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 ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersResponse + * @returns ListAppProfilesRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListClustersResponse; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesRequest; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse + * 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.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersResponse to JSON. + * Converts this ListAppProfilesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { + /** Properties of a ListAppProfilesResponse. */ + interface IListAppProfilesResponse { - /** DeleteClusterRequest name */ - name?: (string|null); + /** ListAppProfilesResponse appProfiles */ + appProfiles?: (google.bigtable.admin.v2.IAppProfile[]|null); + + /** ListAppProfilesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppProfilesResponse failedLocations */ + failedLocations?: (string[]|null); } - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { + /** Represents a ListAppProfilesResponse. */ + class ListAppProfilesResponse implements IListAppProfilesResponse { /** - * Constructs a new DeleteClusterRequest. + * Constructs a new ListAppProfilesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IDeleteClusterRequest); + constructor(properties?: google.bigtable.admin.v2.IListAppProfilesResponse); - /** DeleteClusterRequest name. */ - public name: string; + /** ListAppProfilesResponse appProfiles. */ + public appProfiles: google.bigtable.admin.v2.IAppProfile[]; + + /** ListAppProfilesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppProfilesResponse failedLocations. */ + public failedLocations: string[]; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Creates a new ListAppProfilesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteClusterRequest instance + * @returns ListAppProfilesResponse instance */ - public static create(properties?: google.bigtable.admin.v2.IDeleteClusterRequest): google.bigtable.admin.v2.DeleteClusterRequest; + public static create(properties?: google.bigtable.admin.v2.IListAppProfilesResponse): google.bigtable.admin.v2.ListAppProfilesResponse; /** - * 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 + * 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.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListAppProfilesResponse, 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 + * 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.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListAppProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * 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 DeleteClusterRequest + * @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.DeleteClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListAppProfilesResponse; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest + * @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.DeleteClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListAppProfilesResponse; /** - * Verifies a DeleteClusterRequest message. + * 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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteClusterRequest + * @returns ListAppProfilesResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteClusterRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListAppProfilesResponse; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest + * 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.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListAppProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteClusterRequest to JSON. + * Converts this ListAppProfilesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateInstanceMetadata. */ - interface ICreateInstanceMetadata { + /** Properties of an UpdateAppProfileRequest. */ + interface IUpdateAppProfileRequest { - /** CreateInstanceMetadata originalRequest */ - originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + /** UpdateAppProfileRequest appProfile */ + appProfile?: (google.bigtable.admin.v2.IAppProfile|null); - /** CreateInstanceMetadata requestTime */ - requestTime?: (google.protobuf.ITimestamp|null); + /** UpdateAppProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** CreateInstanceMetadata finishTime */ - finishTime?: (google.protobuf.ITimestamp|null); + /** UpdateAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); } - /** Represents a CreateInstanceMetadata. */ - class CreateInstanceMetadata implements ICreateInstanceMetadata { + /** Represents an UpdateAppProfileRequest. */ + class UpdateAppProfileRequest implements IUpdateAppProfileRequest { /** - * Constructs a new CreateInstanceMetadata. + * Constructs a new UpdateAppProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata); + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest); - /** CreateInstanceMetadata originalRequest. */ - public originalRequest?: (google.bigtable.admin.v2.ICreateInstanceRequest|null); + /** UpdateAppProfileRequest appProfile. */ + public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); - /** CreateInstanceMetadata requestTime. */ - public requestTime?: (google.protobuf.ITimestamp|null); + /** UpdateAppProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** CreateInstanceMetadata finishTime. */ - public finishTime?: (google.protobuf.ITimestamp|null); + /** UpdateAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; /** - * Creates a new CreateInstanceMetadata instance using the specified properties. + * Creates a new UpdateAppProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceMetadata instance + * @returns UpdateAppProfileRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateInstanceMetadata): google.bigtable.admin.v2.CreateInstanceMetadata; + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest): google.bigtable.admin.v2.UpdateAppProfileRequest; /** - * 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 + * 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.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, 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 + * 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.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * 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 CreateInstanceMetadata + * @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.CreateInstanceMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileRequest; /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceMetadata + * @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.CreateInstanceMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileRequest; /** - * Verifies a CreateInstanceMetadata message. + * 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 a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceMetadata + * @returns UpdateAppProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateInstanceMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileRequest; /** - * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. - * @param message CreateInstanceMetadata + * 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.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceMetadata to JSON. + * Converts this UpdateAppProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateInstanceMetadata. */ - interface IUpdateInstanceMetadata { + /** Properties of a DeleteAppProfileRequest. */ + interface IDeleteAppProfileRequest { - /** UpdateInstanceMetadata originalRequest */ - originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); - - /** UpdateInstanceMetadata requestTime */ - requestTime?: (google.protobuf.ITimestamp|null); + /** DeleteAppProfileRequest name */ + name?: (string|null); - /** UpdateInstanceMetadata finishTime */ - finishTime?: (google.protobuf.ITimestamp|null); + /** DeleteAppProfileRequest ignoreWarnings */ + ignoreWarnings?: (boolean|null); } - /** Represents an UpdateInstanceMetadata. */ - class UpdateInstanceMetadata implements IUpdateInstanceMetadata { + /** Represents a DeleteAppProfileRequest. */ + class DeleteAppProfileRequest implements IDeleteAppProfileRequest { /** - * Constructs a new UpdateInstanceMetadata. + * Constructs a new DeleteAppProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata); - - /** UpdateInstanceMetadata originalRequest. */ - public originalRequest?: (google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null); + constructor(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest); - /** UpdateInstanceMetadata requestTime. */ - public requestTime?: (google.protobuf.ITimestamp|null); + /** DeleteAppProfileRequest name. */ + public name: string; - /** UpdateInstanceMetadata finishTime. */ - public finishTime?: (google.protobuf.ITimestamp|null); + /** DeleteAppProfileRequest ignoreWarnings. */ + public ignoreWarnings: boolean; /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. + * Creates a new DeleteAppProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateInstanceMetadata instance + * @returns DeleteAppProfileRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IUpdateInstanceMetadata): google.bigtable.admin.v2.UpdateInstanceMetadata; + public static create(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest): google.bigtable.admin.v2.DeleteAppProfileRequest; /** - * 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 + * 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.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, 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 + * 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.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * 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 UpdateInstanceMetadata + * @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.UpdateInstanceMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAppProfileRequest; /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateInstanceMetadata + * @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.UpdateInstanceMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAppProfileRequest; /** - * Verifies an UpdateInstanceMetadata message. + * 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 an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateInstanceMetadata + * @returns DeleteAppProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateInstanceMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAppProfileRequest; /** - * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. - * @param message UpdateInstanceMetadata + * 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.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.DeleteAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateInstanceMetadata to JSON. + * Converts this DeleteAppProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** 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); + /** Properties of an UpdateAppProfileMetadata. */ + interface IUpdateAppProfileMetadata { } - /** Represents a CreateClusterMetadata. */ - class CreateClusterMetadata implements ICreateClusterMetadata { + /** Represents an UpdateAppProfileMetadata. */ + class UpdateAppProfileMetadata implements IUpdateAppProfileMetadata { /** - * Constructs a new CreateClusterMetadata. + * Constructs a new UpdateAppProfileMetadata. * @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); + constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata); /** - * Creates a new CreateClusterMetadata instance using the specified properties. + * Creates a new UpdateAppProfileMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateClusterMetadata instance + * @returns UpdateAppProfileMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateClusterMetadata): google.bigtable.admin.v2.CreateClusterMetadata; + public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata): google.bigtable.admin.v2.UpdateAppProfileMetadata; /** - * 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 + * 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.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, 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 + * 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.ICreateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * 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 CreateClusterMetadata + * @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.CreateClusterMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileMetadata; /** - * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateClusterMetadata + * @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.CreateClusterMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileMetadata; /** - * Verifies a CreateClusterMetadata message. + * 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 a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateClusterMetadata + * @returns UpdateAppProfileMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileMetadata; /** - * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. - * @param message CreateClusterMetadata + * 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.CreateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateClusterMetadata to JSON. + * Converts this UpdateAppProfileMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateClusterMetadata. */ - interface IUpdateClusterMetadata { + /** Properties of an Instance. */ + interface IInstance { - /** UpdateClusterMetadata originalRequest */ - originalRequest?: (google.bigtable.admin.v2.ICluster|null); + /** Instance name */ + name?: (string|null); - /** UpdateClusterMetadata requestTime */ - requestTime?: (google.protobuf.ITimestamp|null); + /** Instance displayName */ + displayName?: (string|null); - /** UpdateClusterMetadata finishTime */ - finishTime?: (google.protobuf.ITimestamp|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); } - /** Represents an UpdateClusterMetadata. */ - class UpdateClusterMetadata implements IUpdateClusterMetadata { + /** Represents an Instance. */ + class Instance implements IInstance { /** - * Constructs a new UpdateClusterMetadata. + * Constructs a new Instance. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata); + constructor(properties?: google.bigtable.admin.v2.IInstance); - /** UpdateClusterMetadata originalRequest. */ - public originalRequest?: (google.bigtable.admin.v2.ICluster|null); + /** Instance name. */ + public name: string; - /** UpdateClusterMetadata requestTime. */ - public requestTime?: (google.protobuf.ITimestamp|null); + /** Instance displayName. */ + public displayName: string; - /** UpdateClusterMetadata finishTime. */ - public finishTime?: (google.protobuf.ITimestamp|null); + /** 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 }; /** - * Creates a new UpdateClusterMetadata instance using the specified properties. + * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateClusterMetadata instance + * @returns Instance instance */ - public static create(properties?: google.bigtable.admin.v2.IUpdateClusterMetadata): google.bigtable.admin.v2.UpdateClusterMetadata; + public static create(properties?: google.bigtable.admin.v2.IInstance): google.bigtable.admin.v2.Instance; /** - * 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 + * 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.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IInstance, 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 + * 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.IUpdateClusterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * 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 UpdateClusterMetadata + * @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.UpdateClusterMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Instance; /** - * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateClusterMetadata + * @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.UpdateClusterMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Instance; /** - * Verifies an UpdateClusterMetadata message. + * 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 UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateClusterMetadata + * @returns Instance */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateClusterMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Instance; /** - * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. - * @param message UpdateClusterMetadata + * 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.UpdateClusterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateClusterMetadata to JSON. + * Converts this Instance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateAppProfileRequest. */ - interface ICreateAppProfileRequest { + namespace Instance { - /** CreateAppProfileRequest parent */ - parent?: (string|null); + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } - /** CreateAppProfileRequest appProfileId */ - appProfileId?: (string|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRODUCTION = 1, + DEVELOPMENT = 2 + } + } - /** CreateAppProfileRequest appProfile */ - appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + /** Properties of a Cluster. */ + interface ICluster { - /** CreateAppProfileRequest ignoreWarnings */ - ignoreWarnings?: (boolean|null); + /** 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 defaultStorageType */ + defaultStorageType?: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType|null); } - /** Represents a CreateAppProfileRequest. */ - class CreateAppProfileRequest implements ICreateAppProfileRequest { + /** Represents a Cluster. */ + class Cluster implements ICluster { /** - * Constructs a new CreateAppProfileRequest. + * Constructs a new Cluster. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest); + constructor(properties?: google.bigtable.admin.v2.ICluster); - /** CreateAppProfileRequest parent. */ - public parent: string; + /** Cluster name. */ + public name: string; - /** CreateAppProfileRequest appProfileId. */ - public appProfileId: string; + /** Cluster location. */ + public location: string; - /** CreateAppProfileRequest appProfile. */ - public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + /** Cluster state. */ + public state: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State); - /** CreateAppProfileRequest ignoreWarnings. */ - public ignoreWarnings: boolean; + /** Cluster serveNodes. */ + public serveNodes: number; + + /** Cluster defaultStorageType. */ + public defaultStorageType: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType); /** - * Creates a new CreateAppProfileRequest instance using the specified properties. + * Creates a new Cluster instance using the specified properties. * @param [properties] Properties to set - * @returns CreateAppProfileRequest instance + * @returns Cluster instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateAppProfileRequest): google.bigtable.admin.v2.CreateAppProfileRequest; + public static create(properties?: google.bigtable.admin.v2.ICluster): google.bigtable.admin.v2.Cluster; /** - * 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 + * 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.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICluster, 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 + * 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.ICreateAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * 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 CreateAppProfileRequest + * @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.CreateAppProfileRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster; /** - * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a Cluster message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateAppProfileRequest + * @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.CreateAppProfileRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster; /** - * Verifies a CreateAppProfileRequest message. + * 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 CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateAppProfileRequest + * @returns Cluster */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateAppProfileRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster; /** - * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. - * @param message CreateAppProfileRequest + * 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.CreateAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateAppProfileRequest to JSON. + * Converts this Cluster to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetAppProfileRequest. */ - interface IGetAppProfileRequest { + namespace Cluster { - /** GetAppProfileRequest name */ + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2, + RESIZING = 3, + DISABLED = 4 + } + } + + /** 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); } - /** Represents a GetAppProfileRequest. */ - class GetAppProfileRequest implements IGetAppProfileRequest { + /** Represents an AppProfile. */ + class AppProfile implements IAppProfile { /** - * Constructs a new GetAppProfileRequest. + * Constructs a new AppProfile. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGetAppProfileRequest); + constructor(properties?: google.bigtable.admin.v2.IAppProfile); - /** GetAppProfileRequest name. */ + /** 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 routingPolicy. */ + public routingPolicy?: ("multiClusterRoutingUseAny"|"singleClusterRouting"); + /** - * Creates a new GetAppProfileRequest instance using the specified properties. + * Creates a new AppProfile instance using the specified properties. * @param [properties] Properties to set - * @returns GetAppProfileRequest instance + * @returns AppProfile instance */ - public static create(properties?: google.bigtable.admin.v2.IGetAppProfileRequest): google.bigtable.admin.v2.GetAppProfileRequest; + public static create(properties?: google.bigtable.admin.v2.IAppProfile): google.bigtable.admin.v2.AppProfile; /** - * 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 + * 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.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IAppProfile, 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 + * 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.IGetAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * 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 GetAppProfileRequest + * @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.GetAppProfileRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile; /** - * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * Decodes an AppProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetAppProfileRequest + * @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.GetAppProfileRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile; /** - * Verifies a GetAppProfileRequest message. + * 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 a GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetAppProfileRequest + * @returns AppProfile */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetAppProfileRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile; /** - * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. - * @param message GetAppProfileRequest + * 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.GetAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.AppProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetAppProfileRequest to JSON. + * Converts this AppProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListAppProfilesRequest. */ - interface IListAppProfilesRequest { - - /** ListAppProfilesRequest parent */ - parent?: (string|null); + namespace AppProfile { - /** ListAppProfilesRequest pageSize */ - pageSize?: (number|null); + /** Properties of a MultiClusterRoutingUseAny. */ + interface IMultiClusterRoutingUseAny { + } - /** ListAppProfilesRequest pageToken */ - pageToken?: (string|null); - } + /** Represents a MultiClusterRoutingUseAny. */ + class MultiClusterRoutingUseAny implements IMultiClusterRoutingUseAny { - /** Represents a ListAppProfilesRequest. */ - class ListAppProfilesRequest implements IListAppProfilesRequest { + /** + * Constructs a new MultiClusterRoutingUseAny. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny); - /** - * Constructs a new ListAppProfilesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.IListAppProfilesRequest); + /** + * 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; - /** ListAppProfilesRequest parent. */ - public parent: string; + /** + * 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; - /** ListAppProfilesRequest pageSize. */ - public pageSize: number; + /** + * 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; - /** 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 }; - } - - /** 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 }; - } + /** + * 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; - /** Properties of an UpdateAppProfileRequest. */ - interface IUpdateAppProfileRequest { + /** + * 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; - /** UpdateAppProfileRequest appProfile */ - appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + /** + * 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); - /** UpdateAppProfileRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|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; - /** UpdateAppProfileRequest ignoreWarnings */ - ignoreWarnings?: (boolean|null); - } + /** + * 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 }; - /** Represents an UpdateAppProfileRequest. */ - class UpdateAppProfileRequest implements IUpdateAppProfileRequest { + /** + * Converts this MultiClusterRoutingUseAny to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new UpdateAppProfileRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileRequest); + /** Properties of a SingleClusterRouting. */ + interface ISingleClusterRouting { - /** UpdateAppProfileRequest appProfile. */ - public appProfile?: (google.bigtable.admin.v2.IAppProfile|null); + /** SingleClusterRouting clusterId */ + clusterId?: (string|null); - /** UpdateAppProfileRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** SingleClusterRouting allowTransactionalWrites */ + allowTransactionalWrites?: (boolean|null); + } - /** UpdateAppProfileRequest ignoreWarnings. */ - public ignoreWarnings: boolean; + /** Represents a SingleClusterRouting. */ + class SingleClusterRouting implements ISingleClusterRouting { - /** - * 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; + /** + * Constructs a new SingleClusterRouting. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting); - /** - * 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; + /** SingleClusterRouting clusterId. */ + public clusterId: string; - /** - * 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; + /** SingleClusterRouting allowTransactionalWrites. */ + public allowTransactionalWrites: boolean; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this UpdateAppProfileRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of a DeleteAppProfileRequest. */ - interface IDeleteAppProfileRequest { + /** + * 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; - /** DeleteAppProfileRequest name */ - name?: (string|null); + /** + * 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 }; - /** DeleteAppProfileRequest ignoreWarnings */ - ignoreWarnings?: (boolean|null); + /** + * Converts this SingleClusterRouting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** 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; + /** StorageType enum. */ + enum StorageType { + STORAGE_TYPE_UNSPECIFIED = 0, + SSD = 1, + HDD = 2 + } - /** DeleteAppProfileRequest ignoreWarnings. */ - public ignoreWarnings: boolean; + /** Represents a BigtableTableAdmin */ + class BigtableTableAdmin extends $protobuf.rpc.Service { /** - * Creates a new DeleteAppProfileRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAppProfileRequest instance + * 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 */ - public static create(properties?: google.bigtable.admin.v2.IDeleteAppProfileRequest): google.bigtable.admin.v2.DeleteAppProfileRequest; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * 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 + * 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 encode(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): BigtableTableAdmin; /** - * 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 + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table */ - public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteAppProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback): void; /** - * 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 + * Calls CreateTable. + * @param request CreateTableRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteAppProfileRequest; + public createTable(request: google.bigtable.admin.v2.ICreateTableRequest): Promise; /** - * 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 + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteAppProfileRequest; + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback): void; /** - * Verifies a DeleteAppProfileRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateTableFromSnapshot. + * @param request CreateTableFromSnapshotRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): Promise; /** - * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAppProfileRequest + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTablesResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteAppProfileRequest; + public listTables(request: google.bigtable.admin.v2.IListTablesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback): void; /** - * 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 + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @returns Promise */ - public static toObject(message: google.bigtable.admin.v2.DeleteAppProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public listTables(request: google.bigtable.admin.v2.IListTablesRequest): Promise; /** - * Converts this DeleteAppProfileRequest to JSON. - * @returns JSON object + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateAppProfileMetadata. */ - interface IUpdateAppProfileMetadata { - } - - /** Represents an UpdateAppProfileMetadata. */ - class UpdateAppProfileMetadata implements IUpdateAppProfileMetadata { + public getTable(request: google.bigtable.admin.v2.IGetTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback): void; /** - * Constructs a new UpdateAppProfileMetadata. - * @param [properties] Properties to set + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @returns Promise */ - constructor(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata); + public getTable(request: google.bigtable.admin.v2.IGetTableRequest): Promise; /** - * Creates a new UpdateAppProfileMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAppProfileMetadata instance + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.bigtable.admin.v2.IUpdateAppProfileMetadata): google.bigtable.admin.v2.UpdateAppProfileMetadata; + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback): void; /** - * 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 + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @returns Promise */ - public static encode(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest): Promise; /** - * 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 + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table */ - public static encodeDelimited(message: google.bigtable.admin.v2.IUpdateAppProfileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback): void; /** - * 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 + * Calls ModifyColumnFamilies. + * @param request ModifyColumnFamiliesRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.UpdateAppProfileMetadata; + public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): Promise; /** - * 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 + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.UpdateAppProfileMetadata; + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback): void; /** - * Verifies an UpdateAppProfileMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls DropRowRange. + * @param request DropRowRangeRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest): Promise; /** - * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAppProfileMetadata + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.UpdateAppProfileMetadata; + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback): void; /** - * 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 + * Calls GenerateConsistencyToken. + * @param request GenerateConsistencyTokenRequest message or plain object + * @returns Promise */ - public static toObject(message: google.bigtable.admin.v2.UpdateAppProfileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): Promise; /** - * Converts this UpdateAppProfileMetadata to JSON. - * @returns JSON object + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckConsistencyResponse */ - public toJSON(): { [k: string]: any }; - } - - /** 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); - } - - /** Represents an Instance. */ - class Instance implements IInstance { + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback): void; /** - * Constructs a new Instance. - * @param [properties] Properties to set + * Calls CheckConsistency. + * @param request CheckConsistencyRequest message or plain object + * @returns Promise */ - constructor(properties?: google.bigtable.admin.v2.IInstance); + public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest): Promise; - /** Instance name. */ - public name: string; + /** + * 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; - /** Instance displayName. */ - public displayName: string; + /** + * Calls SnapshotTable. + * @param request SnapshotTableRequest message or plain object + * @returns Promise + */ + public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest): Promise; - /** Instance state. */ - public state: (google.bigtable.admin.v2.Instance.State|keyof typeof google.bigtable.admin.v2.Instance.State); + /** + * 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; - /** Instance type. */ - public type: (google.bigtable.admin.v2.Instance.Type|keyof typeof google.bigtable.admin.v2.Instance.Type); + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest): Promise; - /** Instance labels. */ - public labels: { [k: string]: string }; + /** + * 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; /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise */ - public static create(properties?: google.bigtable.admin.v2.IInstance): google.bigtable.admin.v2.Instance; + public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest): Promise; /** - * 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 + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encode(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback): void; /** - * 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 + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.bigtable.admin.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest): Promise; /** - * 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 + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Instance; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback): void; /** - * 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 + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Instance; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static verify(message: { [k: string]: any }): (string|null); + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback): void; /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Instance; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; /** - * 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 + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse */ - public static toObject(message: google.bigtable.admin.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback): void; /** - * Converts this Instance to JSON. - * @returns JSON object + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - 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 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 defaultStorageType */ - defaultStorageType?: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType|null); + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; } - /** Represents a Cluster. */ - class Cluster implements ICluster { + namespace BigtableTableAdmin { /** - * Constructs a new Cluster. - * @param [properties] Properties to set + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#createTable}. + * @param error Error, if any + * @param [response] Table */ - constructor(properties?: google.bigtable.admin.v2.ICluster); - - /** Cluster name. */ - public name: string; + type CreateTableCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; - /** Cluster location. */ - public location: string; + /** + * 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; - /** Cluster state. */ - public state: (google.bigtable.admin.v2.Cluster.State|keyof typeof google.bigtable.admin.v2.Cluster.State); + /** + * 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; - /** Cluster serveNodes. */ - public serveNodes: number; + /** + * 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; - /** Cluster defaultStorageType. */ - public defaultStorageType: (google.bigtable.admin.v2.StorageType|keyof typeof google.bigtable.admin.v2.StorageType); + /** + * 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; /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#modifyColumnFamilies}. + * @param error Error, if any + * @param [response] Table */ - public static create(properties?: google.bigtable.admin.v2.ICluster): google.bigtable.admin.v2.Cluster; + type ModifyColumnFamiliesCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Table) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#dropRowRange}. + * @param error Error, if any + * @param [response] Empty */ - public static encode(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + type DropRowRangeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#generateConsistencyToken}. + * @param error Error, if any + * @param [response] GenerateConsistencyTokenResponse */ - public static encodeDelimited(message: google.bigtable.admin.v2.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + type GenerateConsistencyTokenCallback = (error: (Error|null), response?: google.bigtable.admin.v2.GenerateConsistencyTokenResponse) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#checkConsistency}. + * @param error Error, if any + * @param [response] CheckConsistencyResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Cluster; + type CheckConsistencyCallback = (error: (Error|null), response?: google.bigtable.admin.v2.CheckConsistencyResponse) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#snapshotTable}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Cluster; + type SnapshotTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot */ - public static verify(message: { [k: string]: any }): (string|null); + type GetSnapshotCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Snapshot) => void; /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Cluster; + type ListSnapshotsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSnapshotsResponse) => void; /** - * 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 + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty */ - public static toObject(message: google.bigtable.admin.v2.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Converts this Cluster to JSON. - * @returns JSON object + * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy */ - public toJSON(): { [k: string]: any }; - } + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - namespace Cluster { + /** + * 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; - /** State enum. */ - enum State { - STATE_NOT_KNOWN = 0, - READY = 1, - CREATING = 2, - RESIZING = 3, - DISABLED = 4 - } + /** + * 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; } - /** Properties of an AppProfile. */ - interface IAppProfile { - - /** AppProfile name */ - name?: (string|null); + /** Properties of a CreateTableRequest. */ + interface ICreateTableRequest { - /** AppProfile etag */ - etag?: (string|null); + /** CreateTableRequest parent */ + parent?: (string|null); - /** AppProfile description */ - description?: (string|null); + /** CreateTableRequest tableId */ + tableId?: (string|null); - /** AppProfile multiClusterRoutingUseAny */ - multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + /** CreateTableRequest table */ + table?: (google.bigtable.admin.v2.ITable|null); - /** AppProfile singleClusterRouting */ - singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + /** CreateTableRequest initialSplits */ + initialSplits?: (google.bigtable.admin.v2.CreateTableRequest.ISplit[]|null); } - /** Represents an AppProfile. */ - class AppProfile implements IAppProfile { + /** Represents a CreateTableRequest. */ + class CreateTableRequest implements ICreateTableRequest { /** - * Constructs a new AppProfile. + * Constructs a new CreateTableRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IAppProfile); - - /** AppProfile name. */ - public name: string; - - /** AppProfile etag. */ - public etag: string; + constructor(properties?: google.bigtable.admin.v2.ICreateTableRequest); - /** AppProfile description. */ - public description: string; + /** CreateTableRequest parent. */ + public parent: string; - /** AppProfile multiClusterRoutingUseAny. */ - public multiClusterRoutingUseAny?: (google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null); + /** CreateTableRequest tableId. */ + public tableId: string; - /** AppProfile singleClusterRouting. */ - public singleClusterRouting?: (google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null); + /** CreateTableRequest table. */ + public table?: (google.bigtable.admin.v2.ITable|null); - /** AppProfile routingPolicy. */ - public routingPolicy?: ("multiClusterRoutingUseAny"|"singleClusterRouting"); + /** CreateTableRequest initialSplits. */ + public initialSplits: google.bigtable.admin.v2.CreateTableRequest.ISplit[]; /** - * Creates a new AppProfile instance using the specified properties. + * Creates a new CreateTableRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AppProfile instance + * @returns CreateTableRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IAppProfile): google.bigtable.admin.v2.AppProfile; + public static create(properties?: google.bigtable.admin.v2.ICreateTableRequest): google.bigtable.admin.v2.CreateTableRequest; /** - * 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 + * 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.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICreateTableRequest, 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 + * 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.IAppProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppProfile message from the specified reader or buffer. + * 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 AppProfile + * @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.AppProfile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest; /** - * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppProfile + * @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.AppProfile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest; /** - * Verifies an AppProfile message. + * 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 an AppProfile message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppProfile + * @returns CreateTableRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest; /** - * Creates a plain object from an AppProfile message. Also converts values to other types if specified. - * @param message AppProfile + * 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.AppProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppProfile to JSON. + * Converts this CreateTableRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AppProfile { - - /** Properties of a MultiClusterRoutingUseAny. */ - interface IMultiClusterRoutingUseAny { - } - - /** Represents a MultiClusterRoutingUseAny. */ - class MultiClusterRoutingUseAny implements IMultiClusterRoutingUseAny { - - /** - * Constructs a new MultiClusterRoutingUseAny. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny); - - /** - * 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 }; - } - - /** Properties of a SingleClusterRouting. */ - interface ISingleClusterRouting { + namespace CreateTableRequest { - /** SingleClusterRouting clusterId */ - clusterId?: (string|null); + /** Properties of a Split. */ + interface ISplit { - /** SingleClusterRouting allowTransactionalWrites */ - allowTransactionalWrites?: (boolean|null); + /** Split key */ + key?: (Uint8Array|string|null); } - /** Represents a SingleClusterRouting. */ - class SingleClusterRouting implements ISingleClusterRouting { + /** Represents a Split. */ + class Split implements ISplit { /** - * Constructs a new SingleClusterRouting. + * Constructs a new Split. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting); - - /** SingleClusterRouting clusterId. */ - public clusterId: string; + constructor(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit); - /** SingleClusterRouting allowTransactionalWrites. */ - public allowTransactionalWrites: boolean; + /** Split key. */ + public key: (Uint8Array|string); /** - * Creates a new SingleClusterRouting instance using the specified properties. + * Creates a new Split instance using the specified properties. * @param [properties] Properties to set - * @returns SingleClusterRouting instance + * @returns Split instance */ - public static create(properties?: google.bigtable.admin.v2.AppProfile.ISingleClusterRouting): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + public static create(properties?: google.bigtable.admin.v2.CreateTableRequest.ISplit): google.bigtable.admin.v2.CreateTableRequest.Split; /** - * 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 + * 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.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, 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 + * 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.AppProfile.ISingleClusterRouting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.CreateTableRequest.ISplit, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SingleClusterRouting message from the specified reader or buffer. + * 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 SingleClusterRouting + * @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.AppProfile.SingleClusterRouting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableRequest.Split; /** - * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * Decodes a Split message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SingleClusterRouting + * @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.AppProfile.SingleClusterRouting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableRequest.Split; /** - * Verifies a SingleClusterRouting message. + * 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 SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * Creates a Split message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SingleClusterRouting + * @returns Split */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.SingleClusterRouting; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest.Split; /** - * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. - * @param message SingleClusterRouting + * 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.AppProfile.SingleClusterRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateTableRequest.Split, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SingleClusterRouting to JSON. + * Converts this Split to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Represents a BigtableTableAdmin */ - class BigtableTableAdmin extends $protobuf.rpc.Service { + /** Properties of a CreateTableFromSnapshotRequest. */ + interface ICreateTableFromSnapshotRequest { - /** - * 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); + /** CreateTableFromSnapshotRequest parent */ + parent?: (string|null); + + /** CreateTableFromSnapshotRequest tableId */ + tableId?: (string|null); + + /** CreateTableFromSnapshotRequest sourceSnapshot */ + sourceSnapshot?: (string|null); + } + + /** Represents a CreateTableFromSnapshotRequest. */ + class CreateTableFromSnapshotRequest implements ICreateTableFromSnapshotRequest { /** - * 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. + * Constructs a new CreateTableFromSnapshotRequest. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): BigtableTableAdmin; + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest); + + /** CreateTableFromSnapshotRequest parent. */ + public parent: string; + + /** CreateTableFromSnapshotRequest tableId. */ + public tableId: string; + + /** CreateTableFromSnapshotRequest sourceSnapshot. */ + public sourceSnapshot: string; /** - * Calls CreateTable. - * @param request CreateTableRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Table + * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTableFromSnapshotRequest instance */ - public createTable(request: google.bigtable.admin.v2.ICreateTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableCallback): void; + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; /** - * Calls CreateTable. - * @param request CreateTableRequest message or plain object - * @returns Promise + * 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 createTable(request: google.bigtable.admin.v2.ICreateTableRequest): Promise; + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateTableFromSnapshot. - * @param request CreateTableFromSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * 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 createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshotCallback): void; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateTableFromSnapshot. - * @param request CreateTableFromSnapshotRequest message or plain object - * @returns Promise + * 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 createTableFromSnapshot(request: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; /** - * Calls ListTables. - * @param request ListTablesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTablesResponse + * 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 listTables(request: google.bigtable.admin.v2.IListTablesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ListTablesCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; /** - * Calls ListTables. - * @param request ListTablesRequest message or plain object - * @returns Promise + * Verifies a CreateTableFromSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listTables(request: google.bigtable.admin.v2.IListTablesRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetTable. - * @param request GetTableRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Table + * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTableFromSnapshotRequest */ - public getTable(request: google.bigtable.admin.v2.IGetTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetTableCallback): void; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; /** - * Calls GetTable. - * @param request GetTableRequest message or plain object - * @returns Promise + * 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 getTable(request: google.bigtable.admin.v2.IGetTableRequest): Promise; + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteTable. - * @param request DeleteTableRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Converts this CreateTableFromSnapshotRequest to JSON. + * @returns JSON object */ - public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteTableCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DropRowRangeRequest. */ + interface IDropRowRangeRequest { + + /** DropRowRangeRequest name */ + name?: (string|null); + + /** DropRowRangeRequest rowKeyPrefix */ + rowKeyPrefix?: (Uint8Array|string|null); + + /** DropRowRangeRequest deleteAllDataFromTable */ + deleteAllDataFromTable?: (boolean|null); + } + + /** Represents a DropRowRangeRequest. */ + class DropRowRangeRequest implements IDropRowRangeRequest { /** - * Calls DeleteTable. - * @param request DeleteTableRequest message or plain object - * @returns Promise + * Constructs a new DropRowRangeRequest. + * @param [properties] Properties to set */ - public deleteTable(request: google.bigtable.admin.v2.IDeleteTableRequest): Promise; + constructor(properties?: google.bigtable.admin.v2.IDropRowRangeRequest); + + /** DropRowRangeRequest name. */ + public name: string; + + /** DropRowRangeRequest rowKeyPrefix. */ + public rowKeyPrefix: (Uint8Array|string); + + /** DropRowRangeRequest deleteAllDataFromTable. */ + public deleteAllDataFromTable: boolean; + + /** DropRowRangeRequest target. */ + public target?: ("rowKeyPrefix"|"deleteAllDataFromTable"); /** - * Calls ModifyColumnFamilies. - * @param request ModifyColumnFamiliesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Table + * Creates a new DropRowRangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DropRowRangeRequest instance */ - public modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamiliesCallback): void; + public static create(properties?: google.bigtable.admin.v2.IDropRowRangeRequest): google.bigtable.admin.v2.DropRowRangeRequest; /** - * Calls ModifyColumnFamilies. - * @param request ModifyColumnFamiliesRequest message or plain object - * @returns Promise + * 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 modifyColumnFamilies(request: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): Promise; + public static encode(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DropRowRange. - * @param request DropRowRangeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DropRowRangeCallback): void; + public static encodeDelimited(message: google.bigtable.admin.v2.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DropRowRange. - * @param request DropRowRangeRequest message or plain object - * @returns Promise + * 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 dropRowRange(request: google.bigtable.admin.v2.IDropRowRangeRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DropRowRangeRequest; /** - * Calls GenerateConsistencyToken. - * @param request GenerateConsistencyTokenRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateConsistencyTokenResponse + * 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 generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyTokenCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DropRowRangeRequest; /** - * Calls GenerateConsistencyToken. - * @param request GenerateConsistencyTokenRequest message or plain object - * @returns Promise + * Verifies a DropRowRangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public generateConsistencyToken(request: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CheckConsistency. - * @param request CheckConsistencyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CheckConsistencyResponse + * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropRowRangeRequest */ - public checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistencyCallback): void; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DropRowRangeRequest; /** - * Calls CheckConsistency. - * @param request CheckConsistencyRequest message or plain object - * @returns Promise + * 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 checkConsistency(request: google.bigtable.admin.v2.ICheckConsistencyRequest): Promise; + public static toObject(message: google.bigtable.admin.v2.DropRowRangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls SnapshotTable. - * @param request SnapshotTableRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this DropRowRangeRequest to JSON. + * @returns JSON object */ - public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTableCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** 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 { /** - * Calls SnapshotTable. - * @param request SnapshotTableRequest message or plain object - * @returns Promise + * Constructs a new ListTablesRequest. + * @param [properties] Properties to set */ - public snapshotTable(request: google.bigtable.admin.v2.ISnapshotTableRequest): Promise; + constructor(properties?: google.bigtable.admin.v2.IListTablesRequest); - /** - * 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; + /** ListTablesRequest parent. */ + public parent: string; - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @returns Promise - */ - public getSnapshot(request: google.bigtable.admin.v2.IGetSnapshotRequest): Promise; + /** ListTablesRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); - /** - * 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; + /** ListTablesRequest pageSize. */ + public pageSize: number; + + /** ListTablesRequest pageToken. */ + public pageToken: string; /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @returns Promise + * Creates a new ListTablesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesRequest instance */ - public listSnapshots(request: google.bigtable.admin.v2.IListSnapshotsRequest): Promise; + public static create(properties?: google.bigtable.admin.v2.IListTablesRequest): google.bigtable.admin.v2.ListTablesRequest; /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshotCallback): void; + public static encode(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @returns Promise + * 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 deleteSnapshot(request: google.bigtable.admin.v2.IDeleteSnapshotRequest): Promise; + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * 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 getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicyCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesRequest; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise + * 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 getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesRequest; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Verifies a ListTablesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicyCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesRequest */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesRequest; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * 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 testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissionsCallback): void; + public static toObject(message: google.bigtable.admin.v2.ListTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise + * Converts this ListTablesRequest to JSON. + * @returns JSON object */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + public toJSON(): { [k: string]: any }; } - 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; + /** Properties of a ListTablesResponse. */ + interface IListTablesResponse { - /** - * 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; + /** ListTablesResponse tables */ + tables?: (google.bigtable.admin.v2.ITable[]|null); - /** - * 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; + /** ListTablesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * 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; + /** Represents a ListTablesResponse. */ + class ListTablesResponse implements IListTablesResponse { /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#deleteTable}. - * @param error Error, if any - * @param [response] Empty + * Constructs a new ListTablesResponse. + * @param [properties] Properties to set */ - type DeleteTableCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + constructor(properties?: google.bigtable.admin.v2.IListTablesResponse); - /** - * 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; + /** ListTablesResponse tables. */ + public tables: google.bigtable.admin.v2.ITable[]; - /** - * 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; + /** ListTablesResponse nextPageToken. */ + public nextPageToken: string; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#generateConsistencyToken}. - * @param error Error, if any - * @param [response] GenerateConsistencyTokenResponse + * Creates a new ListTablesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesResponse instance */ - type GenerateConsistencyTokenCallback = (error: (Error|null), response?: google.bigtable.admin.v2.GenerateConsistencyTokenResponse) => void; + public static create(properties?: google.bigtable.admin.v2.IListTablesResponse): google.bigtable.admin.v2.ListTablesResponse; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#checkConsistency}. - * @param error Error, if any - * @param [response] CheckConsistencyResponse + * 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 */ - type CheckConsistencyCallback = (error: (Error|null), response?: google.bigtable.admin.v2.CheckConsistencyResponse) => void; + public static encode(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#snapshotTable}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type SnapshotTableCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.bigtable.admin.v2.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#getSnapshot}. - * @param error Error, if any - * @param [response] Snapshot + * 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 */ - type GetSnapshotCallback = (error: (Error|null), response?: google.bigtable.admin.v2.Snapshot) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListTablesResponse; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#listSnapshots}. - * @param error Error, if any - * @param [response] ListSnapshotsResponse + * 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 */ - type ListSnapshotsCallback = (error: (Error|null), response?: google.bigtable.admin.v2.ListSnapshotsResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListTablesResponse; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#deleteSnapshot}. - * @param error Error, if any - * @param [response] Empty + * Verifies a ListTablesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesResponse */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesResponse; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * 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 */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static toObject(message: google.bigtable.admin.v2.ListTablesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.bigtable.admin.v2.BigtableTableAdmin#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse + * Converts this ListTablesResponse to JSON. + * @returns JSON object */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateTableRequest. */ - interface ICreateTableRequest { - - /** CreateTableRequest parent */ - parent?: (string|null); + public toJSON(): { [k: string]: any }; + } - /** CreateTableRequest tableId */ - tableId?: (string|null); + /** Properties of a GetTableRequest. */ + interface IGetTableRequest { - /** CreateTableRequest table */ - table?: (google.bigtable.admin.v2.ITable|null); + /** GetTableRequest name */ + name?: (string|null); - /** CreateTableRequest initialSplits */ - initialSplits?: (google.bigtable.admin.v2.CreateTableRequest.ISplit[]|null); + /** GetTableRequest view */ + view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); } - /** Represents a CreateTableRequest. */ - class CreateTableRequest implements ICreateTableRequest { + /** Represents a GetTableRequest. */ + class GetTableRequest implements IGetTableRequest { /** - * Constructs a new CreateTableRequest. + * Constructs a new GetTableRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateTableRequest); - - /** CreateTableRequest parent. */ - public parent: string; - - /** CreateTableRequest tableId. */ - public tableId: string; + constructor(properties?: google.bigtable.admin.v2.IGetTableRequest); - /** CreateTableRequest table. */ - public table?: (google.bigtable.admin.v2.ITable|null); + /** GetTableRequest name. */ + public name: string; - /** CreateTableRequest initialSplits. */ - public initialSplits: google.bigtable.admin.v2.CreateTableRequest.ISplit[]; + /** GetTableRequest view. */ + public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); /** - * Creates a new CreateTableRequest instance using the specified properties. + * Creates a new GetTableRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTableRequest instance + * @returns GetTableRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateTableRequest): google.bigtable.admin.v2.CreateTableRequest; + public static create(properties?: google.bigtable.admin.v2.IGetTableRequest): google.bigtable.admin.v2.GetTableRequest; /** - * 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 + * 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.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGetTableRequest, 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 + * 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.ICreateTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTableRequest message from the specified reader or buffer. + * 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 CreateTableRequest + * @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.CreateTableRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetTableRequest; /** - * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTableRequest + * @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.CreateTableRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetTableRequest; /** - * Verifies a CreateTableRequest message. + * 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 CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTableRequest + * @returns GetTableRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetTableRequest; /** - * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. - * @param message CreateTableRequest + * 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.CreateTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GetTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTableRequest to JSON. + * Converts this GetTableRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CreateTableRequest { - - /** Properties of a Split. */ - interface ISplit { - - /** Split key */ - key?: (Uint8Array|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|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 }; - } - } - - /** Properties of a CreateTableFromSnapshotRequest. */ - interface ICreateTableFromSnapshotRequest { - - /** CreateTableFromSnapshotRequest parent */ - parent?: (string|null); - - /** CreateTableFromSnapshotRequest tableId */ - tableId?: (string|null); + /** Properties of a DeleteTableRequest. */ + interface IDeleteTableRequest { - /** CreateTableFromSnapshotRequest sourceSnapshot */ - sourceSnapshot?: (string|null); + /** DeleteTableRequest name */ + name?: (string|null); } - /** Represents a CreateTableFromSnapshotRequest. */ - class CreateTableFromSnapshotRequest implements ICreateTableFromSnapshotRequest { + /** Represents a DeleteTableRequest. */ + class DeleteTableRequest implements IDeleteTableRequest { /** - * Constructs a new CreateTableFromSnapshotRequest. + * Constructs a new DeleteTableRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest); - - /** CreateTableFromSnapshotRequest parent. */ - public parent: string; - - /** CreateTableFromSnapshotRequest tableId. */ - public tableId: string; + constructor(properties?: google.bigtable.admin.v2.IDeleteTableRequest); - /** CreateTableFromSnapshotRequest sourceSnapshot. */ - public sourceSnapshot: string; + /** DeleteTableRequest name. */ + public name: string; /** - * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * Creates a new DeleteTableRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTableFromSnapshotRequest instance + * @returns DeleteTableRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotRequest): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + public static create(properties?: google.bigtable.admin.v2.IDeleteTableRequest): google.bigtable.admin.v2.DeleteTableRequest; /** - * 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 + * 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.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IDeleteTableRequest, 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 + * 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.ICreateTableFromSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * 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 CreateTableFromSnapshotRequest + * @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.CreateTableFromSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteTableRequest; /** - * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTableFromSnapshotRequest + * @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.CreateTableFromSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteTableRequest; /** - * Verifies a CreateTableFromSnapshotRequest message. + * 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 CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTableFromSnapshotRequest + * @returns DeleteTableRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteTableRequest; /** - * Creates a plain object from a CreateTableFromSnapshotRequest message. Also converts values to other types if specified. - * @param message CreateTableFromSnapshotRequest + * 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.CreateTableFromSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.DeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTableFromSnapshotRequest to JSON. + * Converts this DeleteTableRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DropRowRangeRequest. */ - interface IDropRowRangeRequest { + /** Properties of a ModifyColumnFamiliesRequest. */ + interface IModifyColumnFamiliesRequest { - /** DropRowRangeRequest name */ + /** ModifyColumnFamiliesRequest name */ name?: (string|null); - /** DropRowRangeRequest rowKeyPrefix */ - rowKeyPrefix?: (Uint8Array|string|null); - - /** DropRowRangeRequest deleteAllDataFromTable */ - deleteAllDataFromTable?: (boolean|null); + /** ModifyColumnFamiliesRequest modifications */ + modifications?: (google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]|null); } - /** Represents a DropRowRangeRequest. */ - class DropRowRangeRequest implements IDropRowRangeRequest { + /** Represents a ModifyColumnFamiliesRequest. */ + class ModifyColumnFamiliesRequest implements IModifyColumnFamiliesRequest { /** - * Constructs a new DropRowRangeRequest. + * Constructs a new ModifyColumnFamiliesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IDropRowRangeRequest); + constructor(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest); - /** DropRowRangeRequest name. */ + /** ModifyColumnFamiliesRequest name. */ public name: string; - /** DropRowRangeRequest rowKeyPrefix. */ - public rowKeyPrefix: (Uint8Array|string); - - /** DropRowRangeRequest deleteAllDataFromTable. */ - public deleteAllDataFromTable: boolean; - - /** DropRowRangeRequest target. */ - public target?: ("rowKeyPrefix"|"deleteAllDataFromTable"); + /** ModifyColumnFamiliesRequest modifications. */ + public modifications: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]; /** - * Creates a new DropRowRangeRequest instance using the specified properties. + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DropRowRangeRequest instance + * @returns ModifyColumnFamiliesRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IDropRowRangeRequest): google.bigtable.admin.v2.DropRowRangeRequest; + public static create(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; /** - * 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 + * 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.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, 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 + * 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.IDropRowRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * 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 DropRowRangeRequest + * @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.DropRowRangeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; /** - * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DropRowRangeRequest + * @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.DropRowRangeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; /** - * Verifies a DropRowRangeRequest message. + * 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 DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DropRowRangeRequest + * @returns ModifyColumnFamiliesRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DropRowRangeRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; /** - * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. - * @param message DropRowRangeRequest + * 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.DropRowRangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ModifyColumnFamiliesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DropRowRangeRequest to JSON. + * Converts this ModifyColumnFamiliesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListTablesRequest. */ - interface IListTablesRequest { + namespace ModifyColumnFamiliesRequest { - /** ListTablesRequest parent */ - parent?: (string|null); + /** Properties of a Modification. */ + interface IModification { - /** ListTablesRequest view */ - view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + /** Modification id */ + id?: (string|null); - /** ListTablesRequest pageSize */ - pageSize?: (number|null); + /** Modification create */ + create?: (google.bigtable.admin.v2.IColumnFamily|null); - /** ListTablesRequest pageToken */ - pageToken?: (string|null); + /** Modification update */ + update?: (google.bigtable.admin.v2.IColumnFamily|null); + + /** Modification drop */ + drop?: (boolean|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; + + /** 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 }; + } } - /** Represents a ListTablesRequest. */ - class ListTablesRequest implements IListTablesRequest { + /** Properties of a GenerateConsistencyTokenRequest. */ + interface IGenerateConsistencyTokenRequest { + + /** GenerateConsistencyTokenRequest name */ + name?: (string|null); + } + + /** Represents a GenerateConsistencyTokenRequest. */ + class GenerateConsistencyTokenRequest implements IGenerateConsistencyTokenRequest { /** - * Constructs a new ListTablesRequest. + * Constructs a new GenerateConsistencyTokenRequest. * @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; + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest); - /** ListTablesRequest pageToken. */ - public pageToken: string; + /** GenerateConsistencyTokenRequest name. */ + public name: string; /** - * Creates a new ListTablesRequest instance using the specified properties. + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTablesRequest instance + * @returns GenerateConsistencyTokenRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IListTablesRequest): google.bigtable.admin.v2.ListTablesRequest; + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; /** - * 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 + * 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.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, 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 + * 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.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTablesRequest message from the specified reader or buffer. + * 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 ListTablesRequest + * @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.ListTablesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; /** - * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTablesRequest + * @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.ListTablesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; /** - * Verifies a ListTablesRequest message. + * 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 ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTablesRequest + * @returns GenerateConsistencyTokenRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; /** - * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. - * @param message ListTablesRequest + * 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.ListTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTablesRequest to JSON. + * Converts this GenerateConsistencyTokenRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListTablesResponse. */ - interface IListTablesResponse { - - /** ListTablesResponse tables */ - tables?: (google.bigtable.admin.v2.ITable[]|null); + /** Properties of a GenerateConsistencyTokenResponse. */ + interface IGenerateConsistencyTokenResponse { - /** ListTablesResponse nextPageToken */ - nextPageToken?: (string|null); + /** GenerateConsistencyTokenResponse consistencyToken */ + consistencyToken?: (string|null); } - /** Represents a ListTablesResponse. */ - class ListTablesResponse implements IListTablesResponse { + /** Represents a GenerateConsistencyTokenResponse. */ + class GenerateConsistencyTokenResponse implements IGenerateConsistencyTokenResponse { /** - * Constructs a new ListTablesResponse. + * Constructs a new GenerateConsistencyTokenResponse. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListTablesResponse); - - /** ListTablesResponse tables. */ - public tables: google.bigtable.admin.v2.ITable[]; + constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse); - /** ListTablesResponse nextPageToken. */ - public nextPageToken: string; + /** GenerateConsistencyTokenResponse consistencyToken. */ + public consistencyToken: string; /** - * Creates a new ListTablesResponse instance using the specified properties. + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListTablesResponse instance + * @returns GenerateConsistencyTokenResponse instance */ - public static create(properties?: google.bigtable.admin.v2.IListTablesResponse): google.bigtable.admin.v2.ListTablesResponse; + public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; /** - * 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 + * 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.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, 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 + * 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.IListTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTablesResponse message from the specified reader or buffer. + * 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 ListTablesResponse + * @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.ListTablesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; /** - * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTablesResponse + * @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.ListTablesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; /** - * Verifies a ListTablesResponse message. + * 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 ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTablesResponse + * @returns GenerateConsistencyTokenResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListTablesResponse; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; /** - * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. - * @param message ListTablesResponse + * 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.ListTablesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GenerateConsistencyTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTablesResponse to JSON. + * Converts this GenerateConsistencyTokenResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetTableRequest. */ - interface IGetTableRequest { + /** Properties of a CheckConsistencyRequest. */ + interface ICheckConsistencyRequest { - /** GetTableRequest name */ + /** CheckConsistencyRequest name */ name?: (string|null); - /** GetTableRequest view */ - view?: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View|null); + /** CheckConsistencyRequest consistencyToken */ + consistencyToken?: (string|null); } - /** Represents a GetTableRequest. */ - class GetTableRequest implements IGetTableRequest { + /** Represents a CheckConsistencyRequest. */ + class CheckConsistencyRequest implements ICheckConsistencyRequest { /** - * Constructs a new GetTableRequest. + * Constructs a new CheckConsistencyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGetTableRequest); + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest); - /** GetTableRequest name. */ + /** CheckConsistencyRequest name. */ public name: string; - /** GetTableRequest view. */ - public view: (google.bigtable.admin.v2.Table.View|keyof typeof google.bigtable.admin.v2.Table.View); + /** CheckConsistencyRequest consistencyToken. */ + public consistencyToken: string; /** - * Creates a new GetTableRequest instance using the specified properties. + * Creates a new CheckConsistencyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetTableRequest instance + * @returns CheckConsistencyRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IGetTableRequest): google.bigtable.admin.v2.GetTableRequest; + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest): google.bigtable.admin.v2.CheckConsistencyRequest; /** - * 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 + * 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.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyRequest, 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 + * 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.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTableRequest message from the specified reader or buffer. + * 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 GetTableRequest + * @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.GetTableRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyRequest; /** - * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTableRequest + * @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.GetTableRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyRequest; /** - * Verifies a GetTableRequest message. + * 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 GetTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTableRequest + * @returns CheckConsistencyRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetTableRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyRequest; /** - * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. - * @param message GetTableRequest + * 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.GetTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTableRequest to JSON. + * Converts this CheckConsistencyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteTableRequest. */ - interface IDeleteTableRequest { + /** Properties of a CheckConsistencyResponse. */ + interface ICheckConsistencyResponse { - /** DeleteTableRequest name */ - name?: (string|null); + /** CheckConsistencyResponse consistent */ + consistent?: (boolean|null); } - /** Represents a DeleteTableRequest. */ - class DeleteTableRequest implements IDeleteTableRequest { + /** Represents a CheckConsistencyResponse. */ + class CheckConsistencyResponse implements ICheckConsistencyResponse { /** - * Constructs a new DeleteTableRequest. + * Constructs a new CheckConsistencyResponse. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IDeleteTableRequest); + constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse); - /** DeleteTableRequest name. */ - public name: string; + /** CheckConsistencyResponse consistent. */ + public consistent: boolean; /** - * Creates a new DeleteTableRequest instance using the specified properties. + * Creates a new CheckConsistencyResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteTableRequest instance + * @returns CheckConsistencyResponse instance */ - public static create(properties?: google.bigtable.admin.v2.IDeleteTableRequest): google.bigtable.admin.v2.DeleteTableRequest; + public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse): google.bigtable.admin.v2.CheckConsistencyResponse; /** - * 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 + * 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.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICheckConsistencyResponse, 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 + * 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.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteTableRequest message from the specified reader or buffer. + * 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 DeleteTableRequest + * @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.DeleteTableRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CheckConsistencyResponse; /** - * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteTableRequest + * @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.DeleteTableRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CheckConsistencyResponse; /** - * Verifies a DeleteTableRequest message. + * 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 DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteTableRequest + * @returns CheckConsistencyResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteTableRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyResponse; /** - * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. - * @param message DeleteTableRequest + * 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.DeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CheckConsistencyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteTableRequest to JSON. + * Converts this CheckConsistencyResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ModifyColumnFamiliesRequest. */ - interface IModifyColumnFamiliesRequest { + /** Properties of a SnapshotTableRequest. */ + interface ISnapshotTableRequest { - /** ModifyColumnFamiliesRequest name */ + /** SnapshotTableRequest name */ name?: (string|null); - /** ModifyColumnFamiliesRequest modifications */ - modifications?: (google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]|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 ModifyColumnFamiliesRequest. */ - class ModifyColumnFamiliesRequest implements IModifyColumnFamiliesRequest { + /** Represents a SnapshotTableRequest. */ + class SnapshotTableRequest implements ISnapshotTableRequest { /** - * Constructs a new ModifyColumnFamiliesRequest. + * Constructs a new SnapshotTableRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest); + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableRequest); - /** ModifyColumnFamiliesRequest name. */ + /** SnapshotTableRequest name. */ public name: string; - /** ModifyColumnFamiliesRequest modifications. */ - public modifications: google.bigtable.admin.v2.ModifyColumnFamiliesRequest.IModification[]; + /** 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 ModifyColumnFamiliesRequest instance using the specified properties. + * Creates a new SnapshotTableRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ModifyColumnFamiliesRequest instance + * @returns SnapshotTableRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IModifyColumnFamiliesRequest): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableRequest): google.bigtable.admin.v2.SnapshotTableRequest; /** - * 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 + * 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.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ISnapshotTableRequest, 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 + * 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.IModifyColumnFamiliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * 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 ModifyColumnFamiliesRequest + * @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.ModifyColumnFamiliesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableRequest; /** - * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ModifyColumnFamiliesRequest + * @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.ModifyColumnFamiliesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableRequest; /** - * Verifies a ModifyColumnFamiliesRequest message. + * 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 ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ModifyColumnFamiliesRequest + * @returns SnapshotTableRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ModifyColumnFamiliesRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableRequest; /** - * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. - * @param message ModifyColumnFamiliesRequest + * 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.ModifyColumnFamiliesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.SnapshotTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ModifyColumnFamiliesRequest to JSON. + * Converts this SnapshotTableRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - 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); - } - - /** 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; - - /** 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 }; - } - } - - /** Properties of a GenerateConsistencyTokenRequest. */ - interface IGenerateConsistencyTokenRequest { + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { - /** GenerateConsistencyTokenRequest name */ + /** GetSnapshotRequest name */ name?: (string|null); } - /** Represents a GenerateConsistencyTokenRequest. */ - class GenerateConsistencyTokenRequest implements IGenerateConsistencyTokenRequest { + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { /** - * Constructs a new GenerateConsistencyTokenRequest. + * Constructs a new GetSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest); + constructor(properties?: google.bigtable.admin.v2.IGetSnapshotRequest); - /** GenerateConsistencyTokenRequest name. */ + /** GetSnapshotRequest name. */ public name: string; /** - * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * Creates a new GetSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateConsistencyTokenRequest instance + * @returns GetSnapshotRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenRequest): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + public static create(properties?: google.bigtable.admin.v2.IGetSnapshotRequest): google.bigtable.admin.v2.GetSnapshotRequest; /** - * 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 + * 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.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGetSnapshotRequest, 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 + * 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.IGenerateConsistencyTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * 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 GenerateConsistencyTokenRequest + * @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.GenerateConsistencyTokenRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GetSnapshotRequest; /** - * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateConsistencyTokenRequest + * @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.GenerateConsistencyTokenRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GetSnapshotRequest; /** - * Verifies a GenerateConsistencyTokenRequest message. + * 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 GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateConsistencyTokenRequest + * @returns GetSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSnapshotRequest; /** - * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. - * @param message GenerateConsistencyTokenRequest + * 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.GenerateConsistencyTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateConsistencyTokenRequest to JSON. + * Converts this GetSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GenerateConsistencyTokenResponse. */ - interface IGenerateConsistencyTokenResponse { + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { - /** GenerateConsistencyTokenResponse consistencyToken */ - consistencyToken?: (string|null); + /** ListSnapshotsRequest parent */ + parent?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a GenerateConsistencyTokenResponse. */ - class GenerateConsistencyTokenResponse implements IGenerateConsistencyTokenResponse { + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { /** - * Constructs a new GenerateConsistencyTokenResponse. + * Constructs a new ListSnapshotsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse); + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsRequest); + + /** ListSnapshotsRequest parent. */ + public parent: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; - /** GenerateConsistencyTokenResponse consistencyToken. */ - public consistencyToken: string; + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; /** - * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * Creates a new ListSnapshotsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateConsistencyTokenResponse instance + * @returns ListSnapshotsRequest instance */ - public static create(properties?: google.bigtable.admin.v2.IGenerateConsistencyTokenResponse): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsRequest): google.bigtable.admin.v2.ListSnapshotsRequest; /** - * 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 + * 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.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListSnapshotsRequest, 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 + * 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.IGenerateConsistencyTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * 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 GenerateConsistencyTokenResponse + * @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.GenerateConsistencyTokenResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsRequest; /** - * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateConsistencyTokenResponse + * @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.GenerateConsistencyTokenResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsRequest; /** - * Verifies a GenerateConsistencyTokenResponse message. + * 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 GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateConsistencyTokenResponse + * @returns ListSnapshotsRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GenerateConsistencyTokenResponse; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsRequest; /** - * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. - * @param message GenerateConsistencyTokenResponse + * 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.GenerateConsistencyTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateConsistencyTokenResponse to JSON. + * Converts this ListSnapshotsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CheckConsistencyRequest. */ - interface ICheckConsistencyRequest { + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { - /** CheckConsistencyRequest name */ - name?: (string|null); + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.bigtable.admin.v2.ISnapshot[]|null); - /** CheckConsistencyRequest consistencyToken */ - consistencyToken?: (string|null); + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a CheckConsistencyRequest. */ - class CheckConsistencyRequest implements ICheckConsistencyRequest { + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { /** - * Constructs a new CheckConsistencyRequest. + * Constructs a new ListSnapshotsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest); + constructor(properties?: google.bigtable.admin.v2.IListSnapshotsResponse); - /** CheckConsistencyRequest name. */ - public name: string; + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.bigtable.admin.v2.ISnapshot[]; - /** CheckConsistencyRequest consistencyToken. */ - public consistencyToken: string; + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new CheckConsistencyRequest instance using the specified properties. + * Creates a new ListSnapshotsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CheckConsistencyRequest instance + * @returns ListSnapshotsResponse instance */ - public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyRequest): google.bigtable.admin.v2.CheckConsistencyRequest; + public static create(properties?: google.bigtable.admin.v2.IListSnapshotsResponse): google.bigtable.admin.v2.ListSnapshotsResponse; /** - * 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 + * 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.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IListSnapshotsResponse, 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 + * 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.ICheckConsistencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * 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 CheckConsistencyRequest + * @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.CheckConsistencyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ListSnapshotsResponse; /** - * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CheckConsistencyRequest + * @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.CheckConsistencyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ListSnapshotsResponse; /** - * Verifies a CheckConsistencyRequest message. + * 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 CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CheckConsistencyRequest + * @returns ListSnapshotsResponse */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsResponse; /** - * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. - * @param message CheckConsistencyRequest + * 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.CheckConsistencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CheckConsistencyRequest to JSON. + * Converts this ListSnapshotsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CheckConsistencyResponse. */ - interface ICheckConsistencyResponse { + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { - /** CheckConsistencyResponse consistent */ - consistent?: (boolean|null); + /** DeleteSnapshotRequest name */ + name?: (string|null); } - /** Represents a CheckConsistencyResponse. */ - class CheckConsistencyResponse implements ICheckConsistencyResponse { + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { /** - * Constructs a new CheckConsistencyResponse. + * Constructs a new DeleteSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse); + constructor(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest); - /** CheckConsistencyResponse consistent. */ - public consistent: boolean; + /** DeleteSnapshotRequest name. */ + public name: string; /** - * Creates a new CheckConsistencyResponse instance using the specified properties. + * Creates a new DeleteSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CheckConsistencyResponse instance + * @returns DeleteSnapshotRequest instance */ - public static create(properties?: google.bigtable.admin.v2.ICheckConsistencyResponse): google.bigtable.admin.v2.CheckConsistencyResponse; + public static create(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest): google.bigtable.admin.v2.DeleteSnapshotRequest; /** - * 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 + * 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.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, 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 + * 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.ICheckConsistencyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * 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 CheckConsistencyResponse + * @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.CheckConsistencyResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.DeleteSnapshotRequest; /** - * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CheckConsistencyResponse + * @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.CheckConsistencyResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.DeleteSnapshotRequest; /** - * Verifies a CheckConsistencyResponse message. + * 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 CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CheckConsistencyResponse + * @returns DeleteSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CheckConsistencyResponse; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSnapshotRequest; /** - * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. - * @param message CheckConsistencyResponse + * 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.CheckConsistencyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CheckConsistencyResponse to JSON. + * Converts this DeleteSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SnapshotTableRequest. */ - interface ISnapshotTableRequest { - - /** SnapshotTableRequest name */ - name?: (string|null); - - /** SnapshotTableRequest cluster */ - cluster?: (string|null); + /** Properties of a SnapshotTableMetadata. */ + interface ISnapshotTableMetadata { - /** SnapshotTableRequest snapshotId */ - snapshotId?: (string|null); + /** SnapshotTableMetadata originalRequest */ + originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); - /** SnapshotTableRequest ttl */ - ttl?: (google.protobuf.IDuration|null); + /** SnapshotTableMetadata requestTime */ + requestTime?: (google.protobuf.ITimestamp|null); - /** SnapshotTableRequest description */ - description?: (string|null); + /** SnapshotTableMetadata finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); } - /** Represents a SnapshotTableRequest. */ - class SnapshotTableRequest implements ISnapshotTableRequest { + /** Represents a SnapshotTableMetadata. */ + class SnapshotTableMetadata implements ISnapshotTableMetadata { /** - * Constructs a new SnapshotTableRequest. + * Constructs a new SnapshotTableMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ISnapshotTableRequest); - - /** SnapshotTableRequest name. */ - public name: string; - - /** SnapshotTableRequest cluster. */ - public cluster: string; + constructor(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata); - /** SnapshotTableRequest snapshotId. */ - public snapshotId: string; + /** SnapshotTableMetadata originalRequest. */ + public originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); - /** SnapshotTableRequest ttl. */ - public ttl?: (google.protobuf.IDuration|null); + /** SnapshotTableMetadata requestTime. */ + public requestTime?: (google.protobuf.ITimestamp|null); - /** SnapshotTableRequest description. */ - public description: string; + /** SnapshotTableMetadata finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new SnapshotTableRequest instance using the specified properties. + * Creates a new SnapshotTableMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SnapshotTableRequest instance + * @returns SnapshotTableMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.ISnapshotTableRequest): google.bigtable.admin.v2.SnapshotTableRequest; + public static create(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata): google.bigtable.admin.v2.SnapshotTableMetadata; /** - * 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 + * 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.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ISnapshotTableMetadata, 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 + * 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.ISnapshotTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * 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 SnapshotTableRequest + * @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.SnapshotTableRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.SnapshotTableMetadata; /** - * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SnapshotTableRequest + * @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.SnapshotTableRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.SnapshotTableMetadata; /** - * Verifies a SnapshotTableRequest message. + * 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 SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SnapshotTableRequest + * @returns SnapshotTableMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableMetadata; /** - * Creates a plain object from a SnapshotTableRequest message. Also converts values to other types if specified. - * @param message SnapshotTableRequest + * 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.SnapshotTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.SnapshotTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SnapshotTableRequest to JSON. + * Converts this SnapshotTableMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetSnapshotRequest. */ - interface IGetSnapshotRequest { + /** Properties of a CreateTableFromSnapshotMetadata. */ + interface ICreateTableFromSnapshotMetadata { - /** GetSnapshotRequest name */ - name?: (string|null); + /** 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 GetSnapshotRequest. */ - class GetSnapshotRequest implements IGetSnapshotRequest { + /** Represents a CreateTableFromSnapshotMetadata. */ + class CreateTableFromSnapshotMetadata implements ICreateTableFromSnapshotMetadata { /** - * Constructs a new GetSnapshotRequest. + * Constructs a new CreateTableFromSnapshotMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IGetSnapshotRequest); + constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata); - /** GetSnapshotRequest name. */ - public name: string; + /** 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 GetSnapshotRequest instance using the specified properties. + * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns GetSnapshotRequest instance + * @returns CreateTableFromSnapshotMetadata instance */ - public static create(properties?: google.bigtable.admin.v2.IGetSnapshotRequest): google.bigtable.admin.v2.GetSnapshotRequest; + public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; /** - * 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 + * 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.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, 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 + * 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.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * 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 GetSnapshotRequest + * @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.GetSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSnapshotRequest + * @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.GetSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; /** - * Verifies a GetSnapshotRequest message. + * 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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSnapshotRequest + * @returns CreateTableFromSnapshotMetadata */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GetSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @param message GetSnapshotRequest + * 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.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.CreateTableFromSnapshotMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSnapshotRequest to JSON. + * Converts this CreateTableFromSnapshotMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListSnapshotsRequest. */ - interface IListSnapshotsRequest { + /** Properties of a Table. */ + interface ITable { - /** ListSnapshotsRequest parent */ - parent?: (string|null); + /** Table name */ + name?: (string|null); - /** ListSnapshotsRequest pageSize */ - pageSize?: (number|null); + /** Table clusterStates */ + clusterStates?: ({ [k: string]: google.bigtable.admin.v2.Table.IClusterState }|null); - /** ListSnapshotsRequest pageToken */ - pageToken?: (string|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); } - /** Represents a ListSnapshotsRequest. */ - class ListSnapshotsRequest implements IListSnapshotsRequest { + /** Represents a Table. */ + class Table implements ITable { /** - * Constructs a new ListSnapshotsRequest. + * Constructs a new Table. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IListSnapshotsRequest); + constructor(properties?: google.bigtable.admin.v2.ITable); - /** ListSnapshotsRequest parent. */ - public parent: string; + /** Table name. */ + public name: string; - /** ListSnapshotsRequest pageSize. */ - public pageSize: number; + /** Table clusterStates. */ + public clusterStates: { [k: string]: google.bigtable.admin.v2.Table.IClusterState }; - /** ListSnapshotsRequest pageToken. */ - public pageToken: string; + /** 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); /** - * Creates a new ListSnapshotsRequest instance using the specified properties. + * Creates a new Table instance using the specified properties. * @param [properties] Properties to set - * @returns ListSnapshotsRequest instance + * @returns Table instance */ - public static create(properties?: google.bigtable.admin.v2.IListSnapshotsRequest): google.bigtable.admin.v2.ListSnapshotsRequest; + public static create(properties?: google.bigtable.admin.v2.ITable): google.bigtable.admin.v2.Table; /** - * 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 + * 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.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ITable, 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 + * 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.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * 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 ListSnapshotsRequest + * @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.ListSnapshotsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Table; /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * Decodes a Table message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSnapshotsRequest + * @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.ListSnapshotsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Table; /** - * Verifies a ListSnapshotsRequest message. + * 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 ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Table message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSnapshotsRequest + * @returns Table */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ListSnapshotsRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Table; /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListSnapshotsRequest + * 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.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSnapshotsRequest to JSON. + * Converts this Table to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListSnapshotsResponse. */ - interface IListSnapshotsResponse { + namespace Table { - /** ListSnapshotsResponse snapshots */ - snapshots?: (google.bigtable.admin.v2.ISnapshot[]|null); + /** Properties of a ClusterState. */ + interface IClusterState { - /** ListSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** ClusterState replicationState */ + replicationState?: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null); + } - /** Represents a ListSnapshotsResponse. */ - class ListSnapshotsResponse implements IListSnapshotsResponse { + /** Represents a ClusterState. */ + class ClusterState implements IClusterState { - /** - * Constructs a new ListSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.bigtable.admin.v2.IListSnapshotsResponse); + /** + * Constructs a new ClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.Table.IClusterState); - /** ListSnapshotsResponse snapshots. */ - public snapshots: google.bigtable.admin.v2.ISnapshot[]; + /** ClusterState replicationState. */ + public replicationState: (google.bigtable.admin.v2.Table.ClusterState.ReplicationState|keyof typeof google.bigtable.admin.v2.Table.ClusterState.ReplicationState); - /** ListSnapshotsResponse nextPageToken. */ - public nextPageToken: string; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this ClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + namespace ClusterState { - /** - * 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; + /** ReplicationState enum. */ + enum ReplicationState { + STATE_NOT_KNOWN = 0, + INITIALIZING = 1, + PLANNED_MAINTENANCE = 2, + UNPLANNED_MAINTENANCE = 3, + READY = 4 + } + } - /** - * 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 }; + /** TimestampGranularity enum. */ + enum TimestampGranularity { + TIMESTAMP_GRANULARITY_UNSPECIFIED = 0, + MILLIS = 1 + } - /** - * Converts this ListSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** View enum. */ + enum View { + VIEW_UNSPECIFIED = 0, + NAME_ONLY = 1, + SCHEMA_VIEW = 2, + REPLICATION_VIEW = 3, + FULL = 4 + } } - /** Properties of a DeleteSnapshotRequest. */ - interface IDeleteSnapshotRequest { + /** Properties of a ColumnFamily. */ + interface IColumnFamily { - /** DeleteSnapshotRequest name */ - name?: (string|null); + /** ColumnFamily gcRule */ + gcRule?: (google.bigtable.admin.v2.IGcRule|null); } - /** Represents a DeleteSnapshotRequest. */ - class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + /** Represents a ColumnFamily. */ + class ColumnFamily implements IColumnFamily { /** - * Constructs a new DeleteSnapshotRequest. + * Constructs a new ColumnFamily. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest); + constructor(properties?: google.bigtable.admin.v2.IColumnFamily); - /** DeleteSnapshotRequest name. */ - public name: string; + /** ColumnFamily gcRule. */ + public gcRule?: (google.bigtable.admin.v2.IGcRule|null); /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. + * Creates a new ColumnFamily instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteSnapshotRequest instance + * @returns ColumnFamily instance */ - public static create(properties?: google.bigtable.admin.v2.IDeleteSnapshotRequest): google.bigtable.admin.v2.DeleteSnapshotRequest; + public static create(properties?: google.bigtable.admin.v2.IColumnFamily): google.bigtable.admin.v2.ColumnFamily; /** - * 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 + * 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.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IColumnFamily, 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 + * 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.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * 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 DeleteSnapshotRequest + * @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.DeleteSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.ColumnFamily; /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteSnapshotRequest + * @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.DeleteSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.ColumnFamily; /** - * Verifies a DeleteSnapshotRequest message. + * 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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteSnapshotRequest + * @returns ColumnFamily */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.DeleteSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.ColumnFamily; /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @param message DeleteSnapshotRequest + * 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.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.ColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteSnapshotRequest to JSON. + * Converts this ColumnFamily to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SnapshotTableMetadata. */ - interface ISnapshotTableMetadata { + /** Properties of a GcRule. */ + interface IGcRule { - /** SnapshotTableMetadata originalRequest */ - originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + /** GcRule maxNumVersions */ + maxNumVersions?: (number|null); - /** SnapshotTableMetadata requestTime */ - requestTime?: (google.protobuf.ITimestamp|null); + /** GcRule maxAge */ + maxAge?: (google.protobuf.IDuration|null); - /** SnapshotTableMetadata finishTime */ - finishTime?: (google.protobuf.ITimestamp|null); + /** GcRule intersection */ + intersection?: (google.bigtable.admin.v2.GcRule.IIntersection|null); + + /** GcRule union */ + union?: (google.bigtable.admin.v2.GcRule.IUnion|null); } - /** Represents a SnapshotTableMetadata. */ - class SnapshotTableMetadata implements ISnapshotTableMetadata { + /** Represents a GcRule. */ + class GcRule implements IGcRule { /** - * Constructs a new SnapshotTableMetadata. + * Constructs a new GcRule. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata); + constructor(properties?: google.bigtable.admin.v2.IGcRule); - /** SnapshotTableMetadata originalRequest. */ - public originalRequest?: (google.bigtable.admin.v2.ISnapshotTableRequest|null); + /** GcRule maxNumVersions. */ + public maxNumVersions: number; - /** SnapshotTableMetadata requestTime. */ - public requestTime?: (google.protobuf.ITimestamp|null); + /** GcRule maxAge. */ + public maxAge?: (google.protobuf.IDuration|null); - /** SnapshotTableMetadata finishTime. */ - public finishTime?: (google.protobuf.ITimestamp|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 SnapshotTableMetadata instance using the specified properties. + * Creates a new GcRule instance using the specified properties. * @param [properties] Properties to set - * @returns SnapshotTableMetadata instance + * @returns GcRule instance */ - public static create(properties?: google.bigtable.admin.v2.ISnapshotTableMetadata): google.bigtable.admin.v2.SnapshotTableMetadata; + public static create(properties?: google.bigtable.admin.v2.IGcRule): google.bigtable.admin.v2.GcRule; /** - * 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 + * 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.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.IGcRule, 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 + * 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.ISnapshotTableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.IGcRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SnapshotTableMetadata message from the specified reader or buffer. + * 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 SnapshotTableMetadata + * @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.SnapshotTableMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.GcRule; /** - * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. + * Decodes a GcRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SnapshotTableMetadata + * @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.SnapshotTableMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.GcRule; /** - * Verifies a SnapshotTableMetadata message. + * 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 SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SnapshotTableMetadata + * @returns GcRule */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.SnapshotTableMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.GcRule; /** - * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. - * @param message SnapshotTableMetadata + * 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.SnapshotTableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.GcRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SnapshotTableMetadata to JSON. + * Converts this GcRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateTableFromSnapshotMetadata. */ - interface ICreateTableFromSnapshotMetadata { + namespace GcRule { - /** CreateTableFromSnapshotMetadata originalRequest */ - originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + /** Properties of an Intersection. */ + interface IIntersection { - /** CreateTableFromSnapshotMetadata requestTime */ - requestTime?: (google.protobuf.ITimestamp|null); + /** Intersection rules */ + rules?: (google.bigtable.admin.v2.IGcRule[]|null); + } - /** CreateTableFromSnapshotMetadata finishTime */ - finishTime?: (google.protobuf.ITimestamp|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 }; + } + + /** 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 }; + } } - /** Represents a CreateTableFromSnapshotMetadata. */ - class CreateTableFromSnapshotMetadata implements ICreateTableFromSnapshotMetadata { + /** 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 CreateTableFromSnapshotMetadata. + * Constructs a new Snapshot. * @param [properties] Properties to set */ - constructor(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata); + constructor(properties?: google.bigtable.admin.v2.ISnapshot); - /** CreateTableFromSnapshotMetadata originalRequest. */ - public originalRequest?: (google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null); + /** 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); - /** CreateTableFromSnapshotMetadata requestTime. */ - public requestTime?: (google.protobuf.ITimestamp|null); + /** Snapshot state. */ + public state: (google.bigtable.admin.v2.Snapshot.State|keyof typeof google.bigtable.admin.v2.Snapshot.State); - /** CreateTableFromSnapshotMetadata finishTime. */ - public finishTime?: (google.protobuf.ITimestamp|null); + /** Snapshot description. */ + public description: string; /** - * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * Creates a new Snapshot instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTableFromSnapshotMetadata instance + * @returns Snapshot instance */ - public static create(properties?: google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + public static create(properties?: google.bigtable.admin.v2.ISnapshot): google.bigtable.admin.v2.Snapshot; /** - * 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 + * 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.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.bigtable.admin.v2.ISnapshot, 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 + * 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.ICreateTableFromSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.bigtable.admin.v2.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * 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 CreateTableFromSnapshotMetadata + * @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.CreateTableFromSnapshotMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.Snapshot; /** - * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * Decodes a Snapshot message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTableFromSnapshotMetadata + * @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.CreateTableFromSnapshotMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.Snapshot; /** - * Verifies a CreateTableFromSnapshotMetadata message. + * 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 CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTableFromSnapshotMetadata + * @returns Snapshot */ - public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.Snapshot; /** - * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. - * @param message CreateTableFromSnapshotMetadata + * 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.CreateTableFromSnapshotMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.bigtable.admin.v2.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTableFromSnapshotMetadata to JSON. + * Converts this Snapshot to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + + namespace Snapshot { + + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2 + } + } } } @@ -13768,102 +13768,6 @@ export namespace google { } } - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a Timestamp. */ interface ITimestamp { @@ -14056,6 +13960,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Empty. */ interface IEmpty { } diff --git a/protos/protos.js b/protos/protos.js index e9c3b869d..b930451a8 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -66,812 +66,690 @@ */ var v2 = {}; - v2.Table = (function() { + v2.BigtableInstanceAdmin = (function() { /** - * Properties of a Table. + * Constructs a new BigtableInstanceAdmin service. * @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 + * @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; /** - * 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 + * 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. */ - 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]]; - } + BigtableInstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * Table name. - * @member {string} name - * @memberof google.bigtable.admin.v2.Table + * 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 */ - Table.prototype.name = ""; + 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" }); /** - * Table clusterStates. - * @member {Object.} clusterStates - * @memberof google.bigtable.admin.v2.Table + * 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 */ - Table.prototype.clusterStates = $util.emptyObject; /** - * Table columnFamilies. - * @member {Object.} columnFamilies - * @memberof google.bigtable.admin.v2.Table + * 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 */ - Table.prototype.columnFamilies = $util.emptyObject; + 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" }); /** - * Table granularity. - * @member {google.bigtable.admin.v2.Table.TimestampGranularity} granularity - * @memberof google.bigtable.admin.v2.Table + * 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 */ - Table.prototype.granularity = 0; /** - * 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 + * 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 */ - 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 + * 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 */ - Table.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.clusterStates != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("granularity")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.granularity); - return writer; - }; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - Table.decode = function decode(reader, length) { - 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; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - reader.skip().pos++; - if (message.clusterStates === $util.emptyObject) - message.clusterStates = {}; - key = reader.string(); - reader.pos++; - message.clusterStates[key] = $root.google.bigtable.admin.v2.Table.ClusterState.decode(reader, reader.uint32()); - break; - case 3: - reader.skip().pos++; - if (message.columnFamilies === $util.emptyObject) - message.columnFamilies = {}; - key = reader.string(); - reader.pos++; - message.columnFamilies[key] = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); - break; - case 4: - message.granularity = reader.int32(); - 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 + * 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 */ - Table.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + 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" }); /** - * 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 + * 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 */ - Table.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.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; - } - 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 + * 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 */ - 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) { - case "TIMESTAMP_GRANULARITY_UNSPECIFIED": - case 0: - message.granularity = 0; - break; - case "MILLIS": - case 1: - message.granularity = 1; - break; - } - 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 + * 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 */ - 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; - } - 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] : message.granularity; - return object; - }; + 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" }); /** - * Converts this Table to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.Table + * Calls PartialUpdateInstance. + * @function partialUpdateInstance + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin * @instance - * @returns {Object.} JSON object + * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Table.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - Table.ClusterState = (function() { + /** + * 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 + */ - /** - * Properties of a ClusterState. - * @memberof google.bigtable.admin.v2.Table - * @interface IClusterState - * @property {google.bigtable.admin.v2.Table.ClusterState.ReplicationState|null} [replicationState] ClusterState replicationState - */ + /** + * 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" }); - /** - * 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) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls 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 + */ - /** - * ClusterState replicationState. - * @member {google.bigtable.admin.v2.Table.ClusterState.ReplicationState} replicationState - * @memberof google.bigtable.admin.v2.Table.ClusterState - * @instance - */ - ClusterState.prototype.replicationState = 0; + /** + * 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 + */ - /** - * 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 && message.hasOwnProperty("replicationState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.replicationState); - 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) { - 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(); - switch (tag >>> 3) { - case 1: - message.replicationState = reader.int32(); - 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: - break; - } - 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) { - 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; - } - 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.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] : message.replicationState; - 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); - }; - - /** - * ReplicationState enum. - * @name google.bigtable.admin.v2.Table.ClusterState.ReplicationState - * @enum {string} - * @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 - */ - 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; - return values; - })(); - - return ClusterState; - })(); + /** + * 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" }); /** - * TimestampGranularity enum. - * @name google.bigtable.admin.v2.Table.TimestampGranularity - * @enum {string} - * @property {number} TIMESTAMP_GRANULARITY_UNSPECIFIED=0 TIMESTAMP_GRANULARITY_UNSPECIFIED value - * @property {number} MILLIS=1 MILLIS value + * 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 */ - 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 {string} - * @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} FULL=4 FULL value + * 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 */ - 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[4] = "FULL"] = 4; - return values; - })(); - return Table; - })(); - - v2.ColumnFamily = (function() { + /** + * 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" }); /** - * Properties of a ColumnFamily. - * @memberof google.bigtable.admin.v2 - * @interface IColumnFamily - * @property {google.bigtable.admin.v2.IGcRule|null} [gcRule] ColumnFamily gcRule + * 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 */ /** - * 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 + * 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 */ - 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 + * 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 */ - ColumnFamily.prototype.gcRule = null; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - ColumnFamily.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcRule != null && message.hasOwnProperty("gcRule")) - $root.google.bigtable.admin.v2.GcRule.encode(message.gcRule, writer.uint32(/* id 1, wireType 2 =*/10).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 + * 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 */ - ColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + 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" }); /** - * 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 + * 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 */ - ColumnFamily.decode = function decode(reader, length) { - 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(); - switch (tag >>> 3) { - case 1: - message.gcRule = $root.google.bigtable.admin.v2.GcRule.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 + * 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 */ - 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 + * 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 */ - 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; - } - return null; - }; + 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" }); /** - * 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 + * 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 */ - 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); - } - 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 + * 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 */ - ColumnFamily.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcRule = null; - if (message.gcRule != null && message.hasOwnProperty("gcRule")) - object.gcRule = $root.google.bigtable.admin.v2.GcRule.toObject(message.gcRule, options); - return object; - }; /** - * Converts this ColumnFamily to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.ColumnFamily + * Calls CreateAppProfile. + * @function createAppProfile + * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin * @instance - * @returns {Object.} JSON object + * @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 */ - ColumnFamily.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ColumnFamily; - })(); + 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" }); - v2.GcRule = (function() { + /** + * 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 + */ /** - * 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 + * 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 */ /** - * Constructs a new GcRule. - * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GcRule. - * @implements IGcRule + * 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 + */ + + 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.IGcRule=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set */ - function GcRule(properties) { + function CreateInstanceRequest(properties) { + this.clusters = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -879,128 +757,122 @@ } /** - * GcRule maxNumVersions. - * @member {number} maxNumVersions - * @memberof google.bigtable.admin.v2.GcRule - * @instance - */ - GcRule.prototype.maxNumVersions = 0; - - /** - * GcRule maxAge. - * @member {google.protobuf.IDuration|null|undefined} maxAge - * @memberof google.bigtable.admin.v2.GcRule + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @instance */ - GcRule.prototype.maxAge = null; + CreateInstanceRequest.prototype.parent = ""; /** - * GcRule intersection. - * @member {google.bigtable.admin.v2.GcRule.IIntersection|null|undefined} intersection - * @memberof google.bigtable.admin.v2.GcRule + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @instance */ - GcRule.prototype.intersection = null; + CreateInstanceRequest.prototype.instanceId = ""; /** - * GcRule union. - * @member {google.bigtable.admin.v2.GcRule.IUnion|null|undefined} union - * @memberof google.bigtable.admin.v2.GcRule + * CreateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @instance */ - GcRule.prototype.union = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateInstanceRequest.prototype.instance = null; /** - * GcRule rule. - * @member {"maxNumVersions"|"maxAge"|"intersection"|"union"|undefined} rule - * @memberof google.bigtable.admin.v2.GcRule + * CreateInstanceRequest clusters. + * @member {Object.} clusters + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @instance */ - Object.defineProperty(GcRule.prototype, "rule", { - get: $util.oneOfGetter($oneOfFields = ["maxNumVersions", "maxAge", "intersection", "union"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateInstanceRequest.prototype.clusters = $util.emptyObject; /** - * Creates a new GcRule instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static - * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GcRule} GcRule instance + * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest instance */ - GcRule.create = function create(properties) { - return new GcRule(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static - * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @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 */ - GcRule.encode = function encode(message, writer) { + CreateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxNumVersions); - if (message.maxAge != null && message.hasOwnProperty("maxAge")) - $root.google.protobuf.Duration.encode(message.maxAge, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.intersection != null && message.hasOwnProperty("intersection")) - $root.google.bigtable.admin.v2.GcRule.Intersection.encode(message.intersection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.union != null && message.hasOwnProperty("union")) - $root.google.bigtable.admin.v2.GcRule.Union.encode(message.union, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && message.hasOwnProperty("instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clusters != null && message.hasOwnProperty("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 GcRule message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. + * 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.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static - * @param {google.bigtable.admin.v2.IGcRule} message GcRule message or plain object to encode + * @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 */ - GcRule.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcRule message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GcRule + * @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.GcRule} GcRule + * @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 */ - GcRule.decode = function decode(reader, length) { + CreateInstanceRequest.decode = function decode(reader, length) { 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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateInstanceRequest(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxNumVersions = reader.int32(); + message.parent = reader.string(); break; case 2: - message.maxAge = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; case 3: - message.intersection = $root.google.bigtable.admin.v2.GcRule.Intersection.decode(reader, reader.uint32()); + message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); break; case 4: - message.union = $root.google.bigtable.admin.v2.GcRule.Union.decode(reader, reader.uint32()); + reader.skip().pos++; + if (message.clusters === $util.emptyObject) + message.clusters = {}; + key = reader.string(); + reader.pos++; + message.clusters[key] = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1011,593 +883,157 @@ }; /** - * Decodes a GcRule message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @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 */ - GcRule.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcRule message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.bigtable.admin.v2.GcRule + * @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 */ - GcRule.verify = function verify(message) { + CreateInstanceRequest.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.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.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 (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 "union." + error; + return "clusters." + error; } } return null; }; /** - * Creates a GcRule message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GcRule} GcRule + * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest */ - GcRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GcRule) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceRequest) 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); + 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.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); + 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 GcRule message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @static - * @param {google.bigtable.admin.v2.GcRule} message GcRule + * @param {google.bigtable.admin.v2.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcRule.toObject = function toObject(message, options) { + CreateInstanceRequest.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 (options.objects || options.defaults) + object.clusters = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; } - 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"; + 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 GcRule to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GcRule + * @memberof google.bigtable.admin.v2.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - GcRule.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - 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) { - 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(); - 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); - }; - - 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) { - 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(); - 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); - }; - - return Union; - })(); - - return GcRule; + return CreateInstanceRequest; })(); - v2.Snapshot = (function() { + v2.GetInstanceRequest = (function() { /** - * Properties of a Snapshot. + * Properties of a GetInstanceRequest. * @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 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name */ /** - * Constructs a new Snapshot. + * Constructs a new GetInstanceRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a Snapshot. - * @implements ISnapshot + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set */ - function Snapshot(properties) { + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1605,153 +1041,276 @@ } /** - * Snapshot name. + * GetInstanceRequest 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 + * @memberof google.bigtable.admin.v2.GetInstanceRequest * @instance */ - Snapshot.prototype.sourceTable = null; + GetInstanceRequest.prototype.name = ""; /** - * Snapshot dataSizeBytes. - * @member {number|Long} dataSizeBytes - * @memberof google.bigtable.admin.v2.Snapshot - * @instance + * 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 */ - Snapshot.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; /** - * Snapshot createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.bigtable.admin.v2.Snapshot - * @instance + * 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 */ - Snapshot.prototype.createTime = null; + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Snapshot deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.bigtable.admin.v2.Snapshot - * @instance + * 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 */ - Snapshot.prototype.deleteTime = null; + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Snapshot state. - * @member {google.bigtable.admin.v2.Snapshot.State} state - * @memberof google.bigtable.admin.v2.Snapshot + * 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) { + 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(); + 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 */ - Snapshot.prototype.state = 0; + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { /** - * Snapshot description. - * @member {string} description - * @memberof google.bigtable.admin.v2.Snapshot + * 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 */ - Snapshot.prototype.description = ""; + ListInstancesRequest.prototype.parent = ""; /** - * Creates a new Snapshot instance using the specified properties. + * 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.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static - * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.Snapshot} Snapshot instance + * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest instance */ - Snapshot.create = function create(properties) { - return new Snapshot(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static - * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @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 */ - Snapshot.encode = function encode(message, writer) { + ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) - $root.google.bigtable.admin.v2.Table.encode(message.sourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataSizeBytes); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); return writer; }; /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. + * 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.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static - * @param {google.bigtable.admin.v2.ISnapshot} message Snapshot message or plain object to encode + * @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 */ - Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Snapshot message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.Snapshot + * @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.Snapshot} Snapshot + * @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 */ - Snapshot.decode = function decode(reader, length) { + ListInstancesRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = 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(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -1762,901 +1321,606 @@ }; /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @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 */ - Snapshot.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Snapshot message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.bigtable.admin.v2.Snapshot + * @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 */ - Snapshot.verify = function verify(message) { + ListInstancesRequest.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"; + 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 Snapshot message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.Snapshot} Snapshot + * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest */ - Snapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.Snapshot) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListInstancesRequest) 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) { - 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); + 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 Snapshot message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @static - * @param {google.bigtable.admin.v2.Snapshot} message Snapshot + * @param {google.bigtable.admin.v2.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Snapshot.toObject = function toObject(message, options) { + ListInstancesRequest.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 = ""; + object.parent = ""; + object.pageToken = ""; } - 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] : message.state; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + 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 Snapshot to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.Snapshot + * @memberof google.bigtable.admin.v2.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - Snapshot.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.bigtable.admin.v2.Snapshot.State - * @enum {string} - * @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; + return ListInstancesRequest; })(); - /** - * StorageType enum. - * @name google.bigtable.admin.v2.StorageType - * @enum {string} - * @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.ListInstancesResponse = (function() { - v2.BigtableInstanceAdmin = (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 BigtableInstanceAdmin service. + * Constructs a new ListInstancesResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a BigtableInstanceAdmin - * @extends $protobuf.rpc.Service + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set */ - function BigtableInstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + 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]]; } - (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. + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance */ - BigtableInstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * 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 + * ListInstancesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @instance */ + ListInstancesResponse.prototype.failedLocations = $util.emptyArray; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListInstancesResponse * @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" }); + ListInstancesResponse.prototype.nextPageToken = ""; /** - * 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 + * 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); + }; /** - * 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 + * 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 && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; /** - * 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 + * 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 */ - 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" }); + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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()); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListInstancesResponse * @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 + * @returns {Object.} JSON object */ - 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" }); + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v2.PartialUpdateInstanceRequest = (function() { /** - * 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 + * 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 */ /** - * 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 + * 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]]; + } /** - * Calls PartialUpdateInstance. - * @function partialUpdateInstance - * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * PartialUpdateInstanceRequest instance. + * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest * @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" }); + PartialUpdateInstanceRequest.prototype.instance = null; /** - * Calls PartialUpdateInstance. - * @function partialUpdateInstance - * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * PartialUpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest * @instance - * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} request PartialUpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + PartialUpdateInstanceRequest.prototype.updateMask = null; /** - * 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 + * 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); + }; /** - * 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 + * 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 */ - 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" }); + PartialUpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && message.hasOwnProperty("instance")) + $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * 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 + * 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(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - 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" }); + PartialUpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * Calls GetCluster. - * @function getCluster - * @memberof google.bigtable.admin.v2.BigtableInstanceAdmin + * Converts this PartialUpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest * @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#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 + * @returns {Object.} JSON object */ + PartialUpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BigtableInstanceAdmin; + return PartialUpdateInstanceRequest; })(); - v2.CreateInstanceRequest = (function() { + v2.DeleteInstanceRequest = (function() { /** - * Properties of a CreateInstanceRequest. + * Properties of a DeleteInstanceRequest. * @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 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name */ /** - * Constructs a new CreateInstanceRequest. + * Constructs a new DeleteInstanceRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set */ - function CreateInstanceRequest(properties) { - this.clusters = {}; + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2664,122 +1928,75 @@ } /** - * 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 + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @instance */ - CreateInstanceRequest.prototype.clusters = $util.emptyObject; + DeleteInstanceRequest.prototype.name = ""; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static - * @param {google.bigtable.admin.v2.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest instance + * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest instance */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static - * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @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 */ - CreateInstanceRequest.encode = function encode(message, writer) { + DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && message.hasOwnProperty("instance")) - $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.clusters != null && message.hasOwnProperty("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(); - } + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceRequest.verify|verify} messages. + * 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.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static - * @param {google.bigtable.admin.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @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 */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @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.CreateInstanceRequest} CreateInstanceRequest + * @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 */ - CreateInstanceRequest.decode = function decode(reader, length) { + DeleteInstanceRequest.decode = function decode(reader, length) { 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; + 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(); 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: - reader.skip().pos++; - if (message.clusters === $util.emptyObject) - message.clusters = {}; - key = reader.string(); - reader.pos++; - message.clusters[key] = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -2790,157 +2007,109 @@ }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @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 */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequest message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @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 */ - CreateInstanceRequest.verify = function verify(message) { + DeleteInstanceRequest.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; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceRequest) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteInstanceRequest) 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]]); - } - } + 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 CreateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @static - * @param {google.bigtable.admin.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {google.bigtable.admin.v2.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + DeleteInstanceRequest.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); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateInstanceRequest; + return DeleteInstanceRequest; })(); - v2.GetInstanceRequest = (function() { + v2.CreateClusterRequest = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of a CreateClusterRequest. * @memberof google.bigtable.admin.v2 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name + * @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 GetInstanceRequest. + * Constructs a new CreateClusterRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest * @constructor - * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function CreateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2948,75 +2117,101 @@ } /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @instance */ - GetInstanceRequest.prototype.name = ""; + CreateClusterRequest.prototype.parent = ""; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * 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.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static - * @param {google.bigtable.admin.v2.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest instance + * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static - * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @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 */ - GetInstanceRequest.encode = function encode(message, writer) { + CreateClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && message.hasOwnProperty("cluster")) + $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetInstanceRequest.verify|verify} messages. + * 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.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static - * @param {google.bigtable.admin.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @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 */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a CreateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @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.GetInstanceRequest} GetInstanceRequest + * @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 */ - GetInstanceRequest.decode = function decode(reader, length) { + CreateClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -3027,108 +2222,129 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @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 */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies a CreateClusterRequest message. * @function verify - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @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 */ - GetInstanceRequest.verify = function verify(message) { + CreateClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GetInstanceRequest} GetInstanceRequest + * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GetInstanceRequest) + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterRequest) return object; - var message = new $root.google.bigtable.admin.v2.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + 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 GetInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @static - * @param {google.bigtable.admin.v2.GetInstanceRequest} message GetInstanceRequest + * @param {google.bigtable.admin.v2.CreateClusterRequest} message CreateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + CreateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 GetInstanceRequest to JSON. + * Converts this CreateClusterRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GetInstanceRequest + * @memberof google.bigtable.admin.v2.CreateClusterRequest * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + CreateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetInstanceRequest; + return CreateClusterRequest; })(); - v2.ListInstancesRequest = (function() { + v2.GetClusterRequest = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a GetClusterRequest. * @memberof google.bigtable.admin.v2 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name */ /** - * Constructs a new ListInstancesRequest. + * Constructs a new GetClusterRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest * @constructor - * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function GetClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3136,88 +2352,75 @@ } /** - * 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 + * GetClusterRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetClusterRequest * @instance */ - ListInstancesRequest.prototype.pageToken = ""; + GetClusterRequest.prototype.name = ""; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new GetClusterRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest instance + * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest instance */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @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 */ - ListInstancesRequest.encode = function encode(message, writer) { + GetClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesRequest.verify|verify} messages. + * 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.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @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 */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a GetClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @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.ListInstancesRequest} ListInstancesRequest + * @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 */ - ListInstancesRequest.decode = function decode(reader, length) { + GetClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3228,120 +2431,108 @@ }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @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 */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesRequest message. + * Verifies a GetClusterRequest message. * @function verify - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @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 */ - ListInstancesRequest.verify = function verify(message) { + GetClusterRequest.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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListInstancesRequest} ListInstancesRequest + * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListInstancesRequest) + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetClusterRequest) 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); + 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 ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @static - * @param {google.bigtable.admin.v2.ListInstancesRequest} message ListInstancesRequest + * @param {google.bigtable.admin.v2.GetClusterRequest} message GetClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + GetClusterRequest.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; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this GetClusterRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListInstancesRequest + * @memberof google.bigtable.admin.v2.GetClusterRequest * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + GetClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListInstancesRequest; + return GetClusterRequest; })(); - v2.ListInstancesResponse = (function() { + v2.ListClustersRequest = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a ListClustersRequest. * @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 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {string|null} [pageToken] ListClustersRequest pageToken */ /** - * Constructs a new ListInstancesResponse. + * Constructs a new ListClustersRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest * @constructor - * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; - this.failedLocations = []; + function ListClustersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3349,107 +2540,88 @@ } /** - * 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 + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListClustersRequest * @instance */ - ListInstancesResponse.prototype.failedLocations = $util.emptyArray; + ListClustersRequest.prototype.parent = ""; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListClustersRequest * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + ListClustersRequest.prototype.pageToken = ""; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new ListClustersRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse instance + * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @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 */ - ListInstancesResponse.encode = function encode(message, writer) { + ListClustersRequest.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 && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); return writer; }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListInstancesResponse.verify|verify} messages. + * 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.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static - * @param {google.bigtable.admin.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @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 */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a ListClustersRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @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.ListInstancesResponse} ListInstancesResponse + * @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 */ - ListInstancesResponse.decode = function decode(reader, length) { + ListClustersRequest.decode = function decode(reader, length) { 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(); + 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(); 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())); + message.parent = reader.string(); break; case 2: - if (!(message.failedLocations && message.failedLocations.length)) - message.failedLocations = []; - message.failedLocations.push(reader.string()); - break; - case 3: - message.nextPageToken = reader.string(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -3460,155 +2632,120 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @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 */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a ListClustersRequest message. * @function verify - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @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 */ - ListInstancesResponse.verify = function verify(message) { + ListClustersRequest.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"; + 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListInstancesResponse} ListInstancesResponse + * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListInstancesResponse) + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersRequest) 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); + 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 ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @static - * @param {google.bigtable.admin.v2.ListInstancesResponse} message ListInstancesResponse + * @param {google.bigtable.admin.v2.ListClustersRequest} message ListClustersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + ListClustersRequest.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 (options.defaults) { + object.parent = ""; + object.pageToken = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + 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 ListInstancesResponse to JSON. + * Converts this ListClustersRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListInstancesResponse + * @memberof google.bigtable.admin.v2.ListClustersRequest * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + ListClustersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListInstancesResponse; + return ListClustersRequest; })(); - v2.PartialUpdateInstanceRequest = (function() { + v2.ListClustersResponse = (function() { /** - * Properties of a PartialUpdateInstanceRequest. + * Properties of a ListClustersResponse. * @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 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {Array.|null} [failedLocations] ListClustersResponse failedLocations + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken */ /** - * Constructs a new PartialUpdateInstanceRequest. + * Constructs a new ListClustersResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a PartialUpdateInstanceRequest. - * @implements IPartialUpdateInstanceRequest + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse * @constructor - * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set */ - function PartialUpdateInstanceRequest(properties) { + 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) @@ -3616,88 +2753,107 @@ } /** - * PartialUpdateInstanceRequest instance. - * @member {google.bigtable.admin.v2.IInstance|null|undefined} instance - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.bigtable.admin.v2.ListClustersResponse * @instance */ - PartialUpdateInstanceRequest.prototype.instance = null; + ListClustersResponse.prototype.clusters = $util.emptyArray; /** - * PartialUpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * ListClustersResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListClustersResponse * @instance */ - PartialUpdateInstanceRequest.prototype.updateMask = null; + ListClustersResponse.prototype.failedLocations = $util.emptyArray; /** - * Creates a new PartialUpdateInstanceRequest instance using the specified properties. + * 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.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static - * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest instance + * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse instance */ - PartialUpdateInstanceRequest.create = function create(properties) { - return new PartialUpdateInstanceRequest(properties); + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); }; /** - * Encodes the specified PartialUpdateInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static - * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @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 */ - PartialUpdateInstanceRequest.encode = function encode(message, writer) { + ListClustersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instance != null && message.hasOwnProperty("instance")) - $root.google.bigtable.admin.v2.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.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 && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified PartialUpdateInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.PartialUpdateInstanceRequest.verify|verify} messages. + * 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.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static - * @param {google.bigtable.admin.v2.IPartialUpdateInstanceRequest} message PartialUpdateInstanceRequest message or plain object to encode + * @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 */ - PartialUpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer. + * Decodes a ListClustersResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @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.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @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 */ - PartialUpdateInstanceRequest.decode = function decode(reader, length) { + ListClustersResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.instance = $root.google.bigtable.admin.v2.Instance.decode(reader, reader.uint32()); + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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); @@ -3708,126 +2864,154 @@ }; /** - * Decodes a PartialUpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @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 */ - PartialUpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartialUpdateInstanceRequest message. + * Verifies a ListClustersResponse message. * @function verify - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @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 */ - PartialUpdateInstanceRequest.verify = function verify(message) { + ListClustersResponse.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.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.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + 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 PartialUpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.PartialUpdateInstanceRequest} PartialUpdateInstanceRequest + * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse */ - PartialUpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest) + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListClustersResponse) 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); + 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.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); + 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 PartialUpdateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @static - * @param {google.bigtable.admin.v2.PartialUpdateInstanceRequest} message PartialUpdateInstanceRequest + * @param {google.bigtable.admin.v2.ListClustersResponse} message ListClustersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartialUpdateInstanceRequest.toObject = function toObject(message, options) { + ListClustersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.instance = null; - object.updateMask = null; + if (options.arrays || options.defaults) { + object.clusters = []; + object.failedLocations = []; } - 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); + 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 PartialUpdateInstanceRequest to JSON. + * Converts this ListClustersResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.PartialUpdateInstanceRequest + * @memberof google.bigtable.admin.v2.ListClustersResponse * @instance * @returns {Object.} JSON object */ - PartialUpdateInstanceRequest.prototype.toJSON = function toJSON() { + ListClustersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PartialUpdateInstanceRequest; + return ListClustersResponse; })(); - v2.DeleteInstanceRequest = (function() { + v2.DeleteClusterRequest = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a DeleteClusterRequest. * @memberof google.bigtable.admin.v2 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new DeleteClusterRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest * @constructor - * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function DeleteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3835,35 +3019,35 @@ } /** - * DeleteInstanceRequest name. + * DeleteClusterRequest name. * @member {string} name - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @instance */ - DeleteInstanceRequest.prototype.name = ""; + DeleteClusterRequest.prototype.name = ""; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new DeleteClusterRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static - * @param {google.bigtable.admin.v2.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static - * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @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 */ - DeleteInstanceRequest.encode = function encode(message, writer) { + DeleteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) @@ -3872,33 +3056,33 @@ }; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteInstanceRequest.verify|verify} messages. + * 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.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static - * @param {google.bigtable.admin.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @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 */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @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.DeleteInstanceRequest} DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.decode = function decode(reader, length) { + DeleteClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -3914,30 +3098,30 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a DeleteClusterRequest message. * @function verify - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.verify = function verify(message) { + DeleteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -3947,32 +3131,32 @@ }; /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.DeleteInstanceRequest) + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteClusterRequest) return object; - var message = new $root.google.bigtable.admin.v2.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @static - * @param {google.bigtable.admin.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.bigtable.admin.v2.DeleteClusterRequest} message DeleteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + DeleteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -3984,39 +3168,39 @@ }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this DeleteClusterRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.DeleteInstanceRequest + * @memberof google.bigtable.admin.v2.DeleteClusterRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + DeleteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteInstanceRequest; + return DeleteClusterRequest; })(); - v2.CreateClusterRequest = (function() { + v2.CreateInstanceMetadata = (function() { /** - * Properties of a CreateClusterRequest. + * Properties of a CreateInstanceMetadata. * @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 + * @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 CreateClusterRequest. + * Constructs a new CreateInstanceMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest + * @classdesc Represents a CreateInstanceMetadata. + * @implements ICreateInstanceMetadata * @constructor - * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set */ - function CreateClusterRequest(properties) { + function CreateInstanceMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4024,101 +3208,101 @@ } /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * CreateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @instance */ - CreateClusterRequest.prototype.parent = ""; + CreateInstanceMetadata.prototype.originalRequest = null; /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * CreateInstanceMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @instance */ - CreateClusterRequest.prototype.clusterId = ""; + CreateInstanceMetadata.prototype.requestTime = null; /** - * CreateClusterRequest cluster. - * @member {google.bigtable.admin.v2.ICluster|null|undefined} cluster - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * CreateInstanceMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @instance */ - CreateClusterRequest.prototype.cluster = null; + CreateInstanceMetadata.prototype.finishTime = null; /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new CreateInstanceMetadata instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest instance + * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata instance */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); + CreateInstanceMetadata.create = function create(properties) { + return new CreateInstanceMetadata(properties); }; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterRequest.verify|verify} messages. + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @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 */ - CreateClusterRequest.encode = function encode(message, writer) { + CreateInstanceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && message.hasOwnProperty("cluster")) - $root.google.bigtable.admin.v2.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.CreateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, 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. + * 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.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @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 */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @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.CreateClusterRequest} CreateClusterRequest + * @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 */ - CreateClusterRequest.decode = function decode(reader, length) { + CreateInstanceMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.originalRequest = $root.google.bigtable.admin.v2.CreateInstanceRequest.decode(reader, reader.uint32()); break; case 2: - message.clusterId = reader.string(); + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.cluster = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4129,129 +3313,141 @@ }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @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 */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClusterRequest message. + * Verifies a CreateInstanceMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @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 */ - CreateClusterRequest.verify = function verify(message) { + CreateInstanceMetadata.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 (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.CreateInstanceRequest.verify(message.originalRequest); if (error) - return "cluster." + 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 CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateClusterRequest} CreateClusterRequest + * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateClusterRequest) + CreateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceMetadata) 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); + 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 CreateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.CreateClusterRequest} message CreateClusterRequest + * @param {google.bigtable.admin.v2.CreateInstanceMetadata} message CreateInstanceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClusterRequest.toObject = function toObject(message, options) { + CreateInstanceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; + object.originalRequest = null; + object.requestTime = null; + object.finishTime = 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); + 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 CreateClusterRequest to JSON. + * Converts this CreateInstanceMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateClusterRequest + * @memberof google.bigtable.admin.v2.CreateInstanceMetadata * @instance * @returns {Object.} JSON object */ - CreateClusterRequest.prototype.toJSON = function toJSON() { + CreateInstanceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateClusterRequest; + return CreateInstanceMetadata; })(); - v2.GetClusterRequest = (function() { + v2.UpdateInstanceMetadata = (function() { /** - * Properties of a GetClusterRequest. + * Properties of an UpdateInstanceMetadata. * @memberof google.bigtable.admin.v2 - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name + * @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 GetClusterRequest. + * Constructs a new UpdateInstanceMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest + * @classdesc Represents an UpdateInstanceMetadata. + * @implements IUpdateInstanceMetadata * @constructor - * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set */ - function GetClusterRequest(properties) { + function UpdateInstanceMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4259,75 +3455,101 @@ } /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.GetClusterRequest + * UpdateInstanceMetadata originalRequest. + * @member {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @instance */ - GetClusterRequest.prototype.name = ""; + UpdateInstanceMetadata.prototype.originalRequest = null; /** - * Creates a new GetClusterRequest instance using the specified properties. + * 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.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.IGetClusterRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest instance + * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata instance */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); + UpdateInstanceMetadata.create = function create(properties) { + return new UpdateInstanceMetadata(properties); }; /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @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 */ - GetClusterRequest.encode = function encode(message, writer) { + UpdateInstanceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetClusterRequest.verify|verify} messages. + * 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.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @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 */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @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.GetClusterRequest} GetClusterRequest + * @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 */ - GetClusterRequest.decode = function decode(reader, length) { + UpdateInstanceMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -4338,108 +3560,141 @@ }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @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 */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetClusterRequest message. + * Verifies an UpdateInstanceMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @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 */ - GetClusterRequest.verify = function verify(message) { + UpdateInstanceMetadata.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.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 a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GetClusterRequest} GetClusterRequest + * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GetClusterRequest) + UpdateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateInstanceMetadata) return object; - var message = new $root.google.bigtable.admin.v2.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); + 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 a GetClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @static - * @param {google.bigtable.admin.v2.GetClusterRequest} message GetClusterRequest + * @param {google.bigtable.admin.v2.UpdateInstanceMetadata} message UpdateInstanceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetClusterRequest.toObject = function toObject(message, options) { + UpdateInstanceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 GetClusterRequest to JSON. + * Converts this UpdateInstanceMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GetClusterRequest + * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata * @instance * @returns {Object.} JSON object */ - GetClusterRequest.prototype.toJSON = function toJSON() { + UpdateInstanceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetClusterRequest; + return UpdateInstanceMetadata; })(); - v2.ListClustersRequest = (function() { + v2.CreateClusterMetadata = (function() { /** - * Properties of a ListClustersRequest. + * Properties of a CreateClusterMetadata. * @memberof google.bigtable.admin.v2 - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {string|null} [pageToken] ListClustersRequest pageToken + * @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 */ /** - * Constructs a new ListClustersRequest. + * Constructs a new CreateClusterMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest + * @classdesc Represents a CreateClusterMetadata. + * @implements ICreateClusterMetadata * @constructor - * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set */ - function ListClustersRequest(properties) { + function CreateClusterMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4447,88 +3702,101 @@ } /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.bigtable.admin.v2.ListClustersRequest + * CreateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateClusterRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @instance */ - ListClustersRequest.prototype.parent = ""; + CreateClusterMetadata.prototype.originalRequest = null; /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.bigtable.admin.v2.ListClustersRequest + * CreateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @instance */ - ListClustersRequest.prototype.pageToken = ""; + CreateClusterMetadata.prototype.requestTime = null; /** - * Creates a new ListClustersRequest instance using the specified properties. + * CreateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.finishTime = null; + + /** + * Creates a new CreateClusterMetadata instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest instance + * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata instance */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); + CreateClusterMetadata.create = function create(properties) { + return new CreateClusterMetadata(properties); }; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @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 */ - ListClustersRequest.encode = function encode(message, writer) { + CreateClusterMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.CreateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersRequest.verify|verify} messages. + * 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.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @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 */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a CreateClusterMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @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.ListClustersRequest} ListClustersRequest + * @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 */ - ListClustersRequest.decode = function decode(reader, length) { + CreateClusterMetadata.decode = function decode(reader, length) { 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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.decode(reader, reader.uint32()); break; case 2: - message.pageToken = reader.string(); + 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); @@ -4539,120 +3807,141 @@ }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @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 */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + CreateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersRequest message. + * Verifies a CreateClusterMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @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 */ - ListClustersRequest.verify = function verify(message) { + CreateClusterMetadata.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"; + 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; + } return null; }; /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListClustersRequest} ListClustersRequest + * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListClustersRequest) + CreateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata) 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); + 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); + } return message; }; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateClusterMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @static - * @param {google.bigtable.admin.v2.ListClustersRequest} message ListClustersRequest + * @param {google.bigtable.admin.v2.CreateClusterMetadata} message CreateClusterMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersRequest.toObject = function toObject(message, options) { + CreateClusterMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageToken = ""; + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + 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); return object; }; /** - * Converts this ListClustersRequest to JSON. + * Converts this CreateClusterMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListClustersRequest + * @memberof google.bigtable.admin.v2.CreateClusterMetadata * @instance * @returns {Object.} JSON object */ - ListClustersRequest.prototype.toJSON = function toJSON() { + CreateClusterMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListClustersRequest; + return CreateClusterMetadata; })(); - v2.ListClustersResponse = (function() { + v2.UpdateClusterMetadata = (function() { /** - * Properties of a ListClustersResponse. + * Properties of an UpdateClusterMetadata. * @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 + * @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 ListClustersResponse. + * Constructs a new UpdateClusterMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse + * @classdesc Represents an UpdateClusterMetadata. + * @implements IUpdateClusterMetadata * @constructor - * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set */ - function ListClustersResponse(properties) { - this.clusters = []; - this.failedLocations = []; + function UpdateClusterMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4660,107 +3949,101 @@ } /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.bigtable.admin.v2.ListClustersResponse + * UpdateClusterMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICluster|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @instance */ - ListClustersResponse.prototype.clusters = $util.emptyArray; + UpdateClusterMetadata.prototype.originalRequest = null; /** - * ListClustersResponse failedLocations. - * @member {Array.} failedLocations - * @memberof google.bigtable.admin.v2.ListClustersResponse + * UpdateClusterMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @instance */ - ListClustersResponse.prototype.failedLocations = $util.emptyArray; + UpdateClusterMetadata.prototype.requestTime = null; /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.bigtable.admin.v2.ListClustersResponse + * UpdateClusterMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @instance */ - ListClustersResponse.prototype.nextPageToken = ""; + UpdateClusterMetadata.prototype.finishTime = null; /** - * Creates a new ListClustersResponse instance using the specified properties. + * Creates a new UpdateClusterMetadata instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse instance + * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata instance */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); + UpdateClusterMetadata.create = function create(properties) { + return new UpdateClusterMetadata(properties); }; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @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 */ - ListClustersResponse.encode = function encode(message, writer) { + UpdateClusterMetadata.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 && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.Cluster.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListClustersResponse.verify|verify} messages. + * 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.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static - * @param {google.bigtable.admin.v2.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @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 */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes an UpdateClusterMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @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.ListClustersResponse} ListClustersResponse + * @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 */ - ListClustersResponse.decode = function decode(reader, length) { + UpdateClusterMetadata.decode = function decode(reader, length) { 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(); + 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(); 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())); + message.originalRequest = $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()); + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.nextPageToken = reader.string(); + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4771,154 +4054,142 @@ }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @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 */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersResponse message. + * Verifies an UpdateClusterMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @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 */ - ListClustersResponse.verify = function verify(message) { + UpdateClusterMetadata.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.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.Cluster.verify(message.originalRequest); + if (error) + return "originalRequest." + 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.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.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. + * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListClustersResponse} ListClustersResponse + * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListClustersResponse) + UpdateClusterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateClusterMetadata) 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]); - } + 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.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.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); } - 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. + * Creates a plain object from an UpdateClusterMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @static - * @param {google.bigtable.admin.v2.ListClustersResponse} message ListClustersResponse + * @param {google.bigtable.admin.v2.UpdateClusterMetadata} message UpdateClusterMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersResponse.toObject = function toObject(message, options) { + UpdateClusterMetadata.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 (options.defaults) { + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + 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 ListClustersResponse to JSON. + * Converts this UpdateClusterMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListClustersResponse + * @memberof google.bigtable.admin.v2.UpdateClusterMetadata * @instance * @returns {Object.} JSON object */ - ListClustersResponse.prototype.toJSON = function toJSON() { + UpdateClusterMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListClustersResponse; + return UpdateClusterMetadata; })(); - v2.DeleteClusterRequest = (function() { + v2.CreateAppProfileRequest = (function() { /** - * Properties of a DeleteClusterRequest. + * Properties of a CreateAppProfileRequest. * @memberof google.bigtable.admin.v2 - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name + * @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 DeleteClusterRequest. + * Constructs a new CreateAppProfileRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest + * @classdesc Represents a CreateAppProfileRequest. + * @implements ICreateAppProfileRequest * @constructor - * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set */ - function DeleteClusterRequest(properties) { + function CreateAppProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4926,75 +4197,114 @@ } /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * CreateAppProfileRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @instance */ - DeleteClusterRequest.prototype.name = ""; + CreateAppProfileRequest.prototype.parent = ""; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * 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.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest instance + * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest instance */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); + CreateAppProfileRequest.create = function create(properties) { + return new CreateAppProfileRequest(properties); }; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @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 */ - DeleteClusterRequest.encode = function encode(message, writer) { + CreateAppProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreWarnings); return writer; }; /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteClusterRequest.verify|verify} messages. + * 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.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @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 */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes a CreateAppProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @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.DeleteClusterRequest} DeleteClusterRequest + * @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 */ - DeleteClusterRequest.decode = function decode(reader, length) { + CreateAppProfileRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -5005,109 +4315,137 @@ }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @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 */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + CreateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteClusterRequest message. + * Verifies a CreateAppProfileRequest message. * @function verify - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @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 */ - DeleteClusterRequest.verify = function verify(message) { + CreateAppProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.DeleteClusterRequest) + CreateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateAppProfileRequest) return object; - var message = new $root.google.bigtable.admin.v2.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); + 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 DeleteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateAppProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.DeleteClusterRequest} message DeleteClusterRequest + * @param {google.bigtable.admin.v2.CreateAppProfileRequest} message CreateAppProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteClusterRequest.toObject = function toObject(message, options) { + CreateAppProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 DeleteClusterRequest to JSON. + * Converts this CreateAppProfileRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.DeleteClusterRequest + * @memberof google.bigtable.admin.v2.CreateAppProfileRequest * @instance * @returns {Object.} JSON object */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { + CreateAppProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteClusterRequest; + return CreateAppProfileRequest; })(); - v2.CreateInstanceMetadata = (function() { + v2.GetAppProfileRequest = (function() { /** - * Properties of a CreateInstanceMetadata. + * Properties of a GetAppProfileRequest. * @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 + * @interface IGetAppProfileRequest + * @property {string|null} [name] GetAppProfileRequest name */ /** - * Constructs a new CreateInstanceMetadata. + * Constructs a new GetAppProfileRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateInstanceMetadata. - * @implements ICreateInstanceMetadata + * @classdesc Represents a GetAppProfileRequest. + * @implements IGetAppProfileRequest * @constructor - * @param {google.bigtable.admin.v2.ICreateInstanceMetadata=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set */ - function CreateInstanceMetadata(properties) { + function GetAppProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5115,101 +4453,75 @@ } /** - * CreateInstanceMetadata originalRequest. - * @member {google.bigtable.admin.v2.ICreateInstanceRequest|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * GetAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @instance */ - CreateInstanceMetadata.prototype.originalRequest = null; + GetAppProfileRequest.prototype.name = ""; /** - * CreateInstanceMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata - * @instance + * 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 */ - CreateInstanceMetadata.prototype.requestTime = null; + GetAppProfileRequest.create = function create(properties) { + return new GetAppProfileRequest(properties); + }; /** - * 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. + * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @static - * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @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 */ - CreateInstanceMetadata.encode = function encode(message, writer) { + GetAppProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.CreateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateInstanceMetadata.verify|verify} messages. + * 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.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @static - * @param {google.bigtable.admin.v2.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @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 */ - CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + GetAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * Decodes a GetAppProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @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.CreateInstanceMetadata} CreateInstanceMetadata + * @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 */ - CreateInstanceMetadata.decode = function decode(reader, length) { + GetAppProfileRequest.decode = function decode(reader, length) { 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(); + 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(); 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()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -5220,141 +4532,109 @@ }; /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @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 */ - CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + GetAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceMetadata message. + * Verifies a GetAppProfileRequest message. * @function verify - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @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 */ - CreateInstanceMetadata.verify = function verify(message) { + GetAppProfileRequest.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; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateInstanceMetadata} CreateInstanceMetadata + * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest */ - CreateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateInstanceMetadata) + GetAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetAppProfileRequest) 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); - } + 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 CreateInstanceMetadata message. Also converts values to other types if specified. + * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @static - * @param {google.bigtable.admin.v2.CreateInstanceMetadata} message CreateInstanceMetadata + * @param {google.bigtable.admin.v2.GetAppProfileRequest} message GetAppProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceMetadata.toObject = function toObject(message, options) { + GetAppProfileRequest.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); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateInstanceMetadata to JSON. + * Converts this GetAppProfileRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateInstanceMetadata + * @memberof google.bigtable.admin.v2.GetAppProfileRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceMetadata.prototype.toJSON = function toJSON() { + GetAppProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateInstanceMetadata; + return GetAppProfileRequest; })(); - v2.UpdateInstanceMetadata = (function() { + v2.ListAppProfilesRequest = (function() { /** - * Properties of an UpdateInstanceMetadata. + * Properties of a ListAppProfilesRequest. * @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 + * @interface IListAppProfilesRequest + * @property {string|null} [parent] ListAppProfilesRequest parent + * @property {number|null} [pageSize] ListAppProfilesRequest pageSize + * @property {string|null} [pageToken] ListAppProfilesRequest pageToken */ /** - * Constructs a new UpdateInstanceMetadata. + * Constructs a new ListAppProfilesRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents an UpdateInstanceMetadata. - * @implements IUpdateInstanceMetadata + * @classdesc Represents a ListAppProfilesRequest. + * @implements IListAppProfilesRequest * @constructor - * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set */ - function UpdateInstanceMetadata(properties) { + function ListAppProfilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5362,101 +4642,101 @@ } /** - * UpdateInstanceMetadata originalRequest. - * @member {google.bigtable.admin.v2.IPartialUpdateInstanceRequest|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * ListAppProfilesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @instance */ - UpdateInstanceMetadata.prototype.originalRequest = null; + ListAppProfilesRequest.prototype.parent = ""; /** - * UpdateInstanceMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * ListAppProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @instance */ - UpdateInstanceMetadata.prototype.requestTime = null; + ListAppProfilesRequest.prototype.pageSize = 0; /** - * UpdateInstanceMetadata finishTime. - * @member {google.protobuf.ITimestamp|null|undefined} finishTime - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * ListAppProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @instance */ - UpdateInstanceMetadata.prototype.finishTime = null; + ListAppProfilesRequest.prototype.pageToken = ""; /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. + * Creates a new ListAppProfilesRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static - * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata instance + * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest instance */ - UpdateInstanceMetadata.create = function create(properties) { - return new UpdateInstanceMetadata(properties); + ListAppProfilesRequest.create = function create(properties) { + return new ListAppProfilesRequest(properties); }; /** - * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static - * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @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 */ - UpdateInstanceMetadata.encode = function encode(message, writer) { + ListAppProfilesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.PartialUpdateInstanceRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** - * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateInstanceMetadata.verify|verify} messages. + * 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.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static - * @param {google.bigtable.admin.v2.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @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 */ - UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListAppProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * Decodes a ListAppProfilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @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.UpdateInstanceMetadata} UpdateInstanceMetadata + * @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 */ - UpdateInstanceMetadata.decode = function decode(reader, length) { + ListAppProfilesRequest.decode = function decode(reader, length) { 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(); + 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(); 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()); + message.parent = reader.string(); break; case 3: - message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 2: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -5467,141 +4747,128 @@ }; /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @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 */ - UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + ListAppProfilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceMetadata message. + * Verifies a ListAppProfilesRequest message. * @function verify - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @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 */ - UpdateInstanceMetadata.verify = function verify(message) { + ListAppProfilesRequest.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; - } + 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 an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.UpdateInstanceMetadata} UpdateInstanceMetadata + * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest */ - UpdateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.UpdateInstanceMetadata) + ListAppProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesRequest) 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); - } + 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 an UpdateInstanceMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @static - * @param {google.bigtable.admin.v2.UpdateInstanceMetadata} message UpdateInstanceMetadata + * @param {google.bigtable.admin.v2.ListAppProfilesRequest} message ListAppProfilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceMetadata.toObject = function toObject(message, options) { + ListAppProfilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalRequest = null; - object.requestTime = null; - object.finishTime = null; + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - 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); + 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 UpdateInstanceMetadata to JSON. + * Converts this ListAppProfilesRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.UpdateInstanceMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceMetadata.prototype.toJSON = function toJSON() { + ListAppProfilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateInstanceMetadata; + return ListAppProfilesRequest; })(); - v2.CreateClusterMetadata = (function() { + v2.ListAppProfilesResponse = (function() { /** - * Properties of a CreateClusterMetadata. + * Properties of a ListAppProfilesResponse. * @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 + * @interface IListAppProfilesResponse + * @property {Array.|null} [appProfiles] ListAppProfilesResponse appProfiles + * @property {string|null} [nextPageToken] ListAppProfilesResponse nextPageToken + * @property {Array.|null} [failedLocations] ListAppProfilesResponse failedLocations */ /** - * Constructs a new CreateClusterMetadata. + * Constructs a new ListAppProfilesResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateClusterMetadata. - * @implements ICreateClusterMetadata + * @classdesc Represents a ListAppProfilesResponse. + * @implements IListAppProfilesResponse * @constructor - * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set */ - function CreateClusterMetadata(properties) { + 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) @@ -5609,101 +4876,107 @@ } /** - * CreateClusterMetadata originalRequest. - * @member {google.bigtable.admin.v2.ICreateClusterRequest|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * ListAppProfilesResponse appProfiles. + * @member {Array.} appProfiles + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @instance */ - CreateClusterMetadata.prototype.originalRequest = null; + ListAppProfilesResponse.prototype.appProfiles = $util.emptyArray; /** - * CreateClusterMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * ListAppProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @instance */ - CreateClusterMetadata.prototype.requestTime = null; + ListAppProfilesResponse.prototype.nextPageToken = ""; /** - * CreateClusterMetadata finishTime. - * @member {google.protobuf.ITimestamp|null|undefined} finishTime - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * ListAppProfilesResponse failedLocations. + * @member {Array.} failedLocations + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @instance */ - CreateClusterMetadata.prototype.finishTime = null; + ListAppProfilesResponse.prototype.failedLocations = $util.emptyArray; /** - * Creates a new CreateClusterMetadata instance using the specified properties. + * Creates a new ListAppProfilesResponse instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static - * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata instance + * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse instance */ - CreateClusterMetadata.create = function create(properties) { - return new CreateClusterMetadata(properties); + ListAppProfilesResponse.create = function create(properties) { + return new ListAppProfilesResponse(properties); }; /** - * Encodes the specified CreateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static - * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @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 */ - CreateClusterMetadata.encode = function encode(message, writer) { + ListAppProfilesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.CreateClusterRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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 && message.hasOwnProperty("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 CreateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.verify|verify} messages. + * 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.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static - * @param {google.bigtable.admin.v2.ICreateClusterMetadata} message CreateClusterMetadata message or plain object to encode + * @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 */ - CreateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListAppProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClusterMetadata message from the specified reader or buffer. + * Decodes a ListAppProfilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @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.CreateClusterMetadata} CreateClusterMetadata + * @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 */ - CreateClusterMetadata.decode = function decode(reader, length) { + ListAppProfilesResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.originalRequest = $root.google.bigtable.admin.v2.CreateClusterRequest.decode(reader, reader.uint32()); + 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.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; case 3: - message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.failedLocations && message.failedLocations.length)) + message.failedLocations = []; + message.failedLocations.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -5714,141 +4987,156 @@ }; /** - * Decodes a CreateClusterMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @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 */ - CreateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + ListAppProfilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClusterMetadata message. + * Verifies a ListAppProfilesResponse message. * @function verify - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @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 */ - CreateClusterMetadata.verify = function verify(message) { + ListAppProfilesResponse.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.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; + } } - return null; + 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 CreateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListAppProfilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateClusterMetadata} CreateClusterMetadata + * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse */ - CreateClusterMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata) + ListAppProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesResponse) 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); + 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.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.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 CreateClusterMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @static - * @param {google.bigtable.admin.v2.CreateClusterMetadata} message CreateClusterMetadata + * @param {google.bigtable.admin.v2.ListAppProfilesResponse} message ListAppProfilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClusterMetadata.toObject = function toObject(message, options) { + ListAppProfilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.originalRequest = null; - object.requestTime = null; - object.finishTime = null; + 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]; } - 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); return object; }; /** - * Converts this CreateClusterMetadata to JSON. + * Converts this ListAppProfilesResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @memberof google.bigtable.admin.v2.ListAppProfilesResponse * @instance * @returns {Object.} JSON object */ - CreateClusterMetadata.prototype.toJSON = function toJSON() { + ListAppProfilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateClusterMetadata; + return ListAppProfilesResponse; })(); - v2.UpdateClusterMetadata = (function() { + v2.UpdateAppProfileRequest = (function() { /** - * Properties of an UpdateClusterMetadata. + * Properties of an UpdateAppProfileRequest. * @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 + * @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 UpdateClusterMetadata. + * Constructs a new UpdateAppProfileRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents an UpdateClusterMetadata. - * @implements IUpdateClusterMetadata + * @classdesc Represents an UpdateAppProfileRequest. + * @implements IUpdateAppProfileRequest * @constructor - * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set */ - function UpdateClusterMetadata(properties) { + function UpdateAppProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5856,101 +5144,101 @@ } /** - * UpdateClusterMetadata originalRequest. - * @member {google.bigtable.admin.v2.ICluster|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * UpdateAppProfileRequest appProfile. + * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @instance */ - UpdateClusterMetadata.prototype.originalRequest = null; + UpdateAppProfileRequest.prototype.appProfile = null; /** - * UpdateClusterMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * UpdateAppProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @instance */ - UpdateClusterMetadata.prototype.requestTime = null; + UpdateAppProfileRequest.prototype.updateMask = null; /** - * UpdateClusterMetadata finishTime. - * @member {google.protobuf.ITimestamp|null|undefined} finishTime - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * UpdateAppProfileRequest ignoreWarnings. + * @member {boolean} ignoreWarnings + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @instance */ - UpdateClusterMetadata.prototype.finishTime = null; + UpdateAppProfileRequest.prototype.ignoreWarnings = false; /** - * Creates a new UpdateClusterMetadata instance using the specified properties. + * Creates a new UpdateAppProfileRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IUpdateClusterMetadata=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest instance */ - UpdateClusterMetadata.create = function create(properties) { - return new UpdateClusterMetadata(properties); + UpdateAppProfileRequest.create = function create(properties) { + return new UpdateAppProfileRequest(properties); }; /** - * Encodes the specified UpdateClusterMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @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 */ - UpdateClusterMetadata.encode = function encode(message, writer) { + UpdateAppProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.Cluster.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appProfile != null && message.hasOwnProperty("appProfile")) + $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); return writer; }; /** - * Encodes the specified UpdateClusterMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateClusterMetadata.verify|verify} messages. + * 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.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.IUpdateClusterMetadata} message UpdateClusterMetadata message or plain object to encode + * @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 */ - UpdateClusterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateClusterMetadata message from the specified reader or buffer. + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @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.UpdateClusterMetadata} UpdateClusterMetadata + * @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 */ - UpdateClusterMetadata.decode = function decode(reader, length) { + UpdateAppProfileRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.originalRequest = $root.google.bigtable.admin.v2.Cluster.decode(reader, reader.uint32()); + message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); break; case 2: - message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 3: - message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.ignoreWarnings = reader.bool(); break; default: reader.skipType(tag & 7); @@ -5961,142 +5249,135 @@ }; /** - * Decodes an UpdateClusterMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @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 */ - UpdateClusterMetadata.decodeDelimited = function decodeDelimited(reader) { + UpdateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateClusterMetadata message. + * Verifies an UpdateAppProfileRequest message. * @function verify - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @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 */ - UpdateClusterMetadata.verify = function verify(message) { + UpdateAppProfileRequest.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 (message.appProfile != null && message.hasOwnProperty("appProfile")) { + var error = $root.google.bigtable.admin.v2.AppProfile.verify(message.appProfile); if (error) - return "requestTime." + error; + return "appProfile." + error; } - if (message.finishTime != null && message.hasOwnProperty("finishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "finishTime." + error; + return "updateMask." + error; } + if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) + if (typeof message.ignoreWarnings !== "boolean") + return "ignoreWarnings: boolean expected"; return null; }; /** - * Creates an UpdateClusterMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.UpdateClusterMetadata} UpdateClusterMetadata + * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest */ - UpdateClusterMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.UpdateClusterMetadata) + UpdateAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileRequest) 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); + 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.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); + 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 UpdateClusterMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAppProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @static - * @param {google.bigtable.admin.v2.UpdateClusterMetadata} message UpdateClusterMetadata + * @param {google.bigtable.admin.v2.UpdateAppProfileRequest} message UpdateAppProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateClusterMetadata.toObject = function toObject(message, options) { + UpdateAppProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalRequest = null; - object.requestTime = null; - object.finishTime = null; + object.appProfile = null; + object.updateMask = null; + object.ignoreWarnings = false; } - 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); + 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 UpdateClusterMetadata to JSON. + * Converts this UpdateAppProfileRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.UpdateClusterMetadata + * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest * @instance * @returns {Object.} JSON object */ - UpdateClusterMetadata.prototype.toJSON = function toJSON() { + UpdateAppProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateClusterMetadata; + return UpdateAppProfileRequest; })(); - v2.CreateAppProfileRequest = (function() { + v2.DeleteAppProfileRequest = (function() { /** - * Properties of a CreateAppProfileRequest. + * Properties of a DeleteAppProfileRequest. * @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 + * @interface IDeleteAppProfileRequest + * @property {string|null} [name] DeleteAppProfileRequest name + * @property {boolean|null} [ignoreWarnings] DeleteAppProfileRequest ignoreWarnings */ /** - * Constructs a new CreateAppProfileRequest. + * Constructs a new DeleteAppProfileRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateAppProfileRequest. - * @implements ICreateAppProfileRequest + * @classdesc Represents a DeleteAppProfileRequest. + * @implements IDeleteAppProfileRequest * @constructor - * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set */ - function CreateAppProfileRequest(properties) { + function DeleteAppProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6104,113 +5385,87 @@ } /** - * 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 + * DeleteAppProfileRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @instance */ - CreateAppProfileRequest.prototype.appProfile = null; + DeleteAppProfileRequest.prototype.name = ""; /** - * CreateAppProfileRequest ignoreWarnings. + * DeleteAppProfileRequest ignoreWarnings. * @member {boolean} ignoreWarnings - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @instance */ - CreateAppProfileRequest.prototype.ignoreWarnings = false; + DeleteAppProfileRequest.prototype.ignoreWarnings = false; /** - * Creates a new CreateAppProfileRequest instance using the specified properties. + * Creates a new DeleteAppProfileRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static - * @param {google.bigtable.admin.v2.ICreateAppProfileRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest instance + * @param {google.bigtable.admin.v2.IDeleteAppProfileRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest instance */ - CreateAppProfileRequest.create = function create(properties) { - return new CreateAppProfileRequest(properties); + DeleteAppProfileRequest.create = function create(properties) { + return new DeleteAppProfileRequest(properties); }; /** - * Encodes the specified CreateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * Encodes the specified DeleteAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteAppProfileRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static - * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @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 */ - CreateAppProfileRequest.encode = function encode(message, writer) { + DeleteAppProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appProfileId); - if (message.appProfile != null && message.hasOwnProperty("appProfile")) - $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreWarnings); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreWarnings); return writer; }; /** - * Encodes the specified CreateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateAppProfileRequest.verify|verify} messages. + * 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.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static - * @param {google.bigtable.admin.v2.ICreateAppProfileRequest} message CreateAppProfileRequest message or plain object to encode + * @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 */ - CreateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateAppProfileRequest message from the specified reader or buffer. + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @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.CreateAppProfileRequest} CreateAppProfileRequest + * @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 */ - CreateAppProfileRequest.decode = function decode(reader, length) { + DeleteAppProfileRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = 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: @@ -6222,43 +5477,35 @@ }; /** - * Decodes a CreateAppProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteAppProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @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 */ - CreateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateAppProfileRequest message. + * Verifies a DeleteAppProfileRequest message. * @function verify - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @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 */ - CreateAppProfileRequest.verify = function verify(message) { + DeleteAppProfileRequest.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.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"; @@ -6266,93 +5513,79 @@ }; /** - * Creates a CreateAppProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAppProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateAppProfileRequest} CreateAppProfileRequest + * @returns {google.bigtable.admin.v2.DeleteAppProfileRequest} DeleteAppProfileRequest */ - CreateAppProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateAppProfileRequest) + DeleteAppProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteAppProfileRequest) 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); - } + 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 CreateAppProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAppProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @static - * @param {google.bigtable.admin.v2.CreateAppProfileRequest} message CreateAppProfileRequest + * @param {google.bigtable.admin.v2.DeleteAppProfileRequest} message DeleteAppProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateAppProfileRequest.toObject = function toObject(message, options) { + DeleteAppProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.appProfileId = ""; - object.appProfile = null; + object.name = ""; 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.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) object.ignoreWarnings = message.ignoreWarnings; return object; }; /** - * Converts this CreateAppProfileRequest to JSON. + * Converts this DeleteAppProfileRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateAppProfileRequest + * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest * @instance * @returns {Object.} JSON object */ - CreateAppProfileRequest.prototype.toJSON = function toJSON() { + DeleteAppProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateAppProfileRequest; + return DeleteAppProfileRequest; })(); - v2.GetAppProfileRequest = (function() { + v2.UpdateAppProfileMetadata = (function() { /** - * Properties of a GetAppProfileRequest. + * Properties of an UpdateAppProfileMetadata. * @memberof google.bigtable.admin.v2 - * @interface IGetAppProfileRequest - * @property {string|null} [name] GetAppProfileRequest name + * @interface IUpdateAppProfileMetadata */ /** - * Constructs a new GetAppProfileRequest. + * Constructs a new UpdateAppProfileMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GetAppProfileRequest. - * @implements IGetAppProfileRequest + * @classdesc Represents an UpdateAppProfileMetadata. + * @implements IUpdateAppProfileMetadata * @constructor - * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set */ - function GetAppProfileRequest(properties) { + function UpdateAppProfileMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6360,76 +5593,63 @@ } /** - * GetAppProfileRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.GetAppProfileRequest - * @instance - */ - GetAppProfileRequest.prototype.name = ""; - - /** - * Creates a new GetAppProfileRequest instance using the specified properties. + * Creates a new UpdateAppProfileMetadata instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static - * @param {google.bigtable.admin.v2.IGetAppProfileRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest instance + * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata instance */ - GetAppProfileRequest.create = function create(properties) { - return new GetAppProfileRequest(properties); + UpdateAppProfileMetadata.create = function create(properties) { + return new UpdateAppProfileMetadata(properties); }; /** - * Encodes the specified GetAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * Encodes the specified UpdateAppProfileMetadata message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static - * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @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 */ - GetAppProfileRequest.encode = function encode(message, writer) { + UpdateAppProfileMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GetAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetAppProfileRequest.verify|verify} messages. + * 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.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static - * @param {google.bigtable.admin.v2.IGetAppProfileRequest} message GetAppProfileRequest message or plain object to encode + * @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 */ - GetAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAppProfileMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetAppProfileRequest message from the specified reader or buffer. + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @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.GetAppProfileRequest} GetAppProfileRequest + * @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 */ - GetAppProfileRequest.decode = function decode(reader, length) { + UpdateAppProfileMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -6439,109 +5659,99 @@ }; /** - * Decodes a GetAppProfileRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateAppProfileMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @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 */ - GetAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateAppProfileMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetAppProfileRequest message. + * Verifies an UpdateAppProfileMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @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 */ - GetAppProfileRequest.verify = function verify(message) { + UpdateAppProfileMetadata.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. + * Creates an UpdateAppProfileMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GetAppProfileRequest} GetAppProfileRequest + * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata */ - GetAppProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GetAppProfileRequest) + UpdateAppProfileMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileMetadata) return object; - var message = new $root.google.bigtable.admin.v2.GetAppProfileRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.bigtable.admin.v2.UpdateAppProfileMetadata(); }; /** - * Creates a plain object from a GetAppProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAppProfileMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @static - * @param {google.bigtable.admin.v2.GetAppProfileRequest} message GetAppProfileRequest + * @param {google.bigtable.admin.v2.UpdateAppProfileMetadata} message UpdateAppProfileMetadata * @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; + UpdateAppProfileMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this GetAppProfileRequest to JSON. + * Converts this UpdateAppProfileMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GetAppProfileRequest + * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata * @instance * @returns {Object.} JSON object */ - GetAppProfileRequest.prototype.toJSON = function toJSON() { + UpdateAppProfileMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetAppProfileRequest; + return UpdateAppProfileMetadata; })(); - v2.ListAppProfilesRequest = (function() { + v2.Instance = (function() { /** - * Properties of a ListAppProfilesRequest. + * Properties of an Instance. * @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 + * @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 */ /** - * Constructs a new ListAppProfilesRequest. + * Constructs a new Instance. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListAppProfilesRequest. - * @implements IListAppProfilesRequest + * @classdesc Represents an Instance. + * @implements IInstance * @constructor - * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set */ - function ListAppProfilesRequest(properties) { + function Instance(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6549,101 +5759,133 @@ } /** - * ListAppProfilesRequest parent. - * @member {string} parent - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * Instance name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Instance * @instance */ - ListAppProfilesRequest.prototype.parent = ""; + Instance.prototype.name = ""; /** - * ListAppProfilesRequest pageSize. - * @member {number} pageSize - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * Instance displayName. + * @member {string} displayName + * @memberof google.bigtable.admin.v2.Instance * @instance */ - ListAppProfilesRequest.prototype.pageSize = 0; + Instance.prototype.displayName = ""; /** - * ListAppProfilesRequest pageToken. - * @member {string} pageToken - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * Instance state. + * @member {google.bigtable.admin.v2.Instance.State} state + * @memberof google.bigtable.admin.v2.Instance * @instance */ - ListAppProfilesRequest.prototype.pageToken = ""; + Instance.prototype.state = 0; /** - * Creates a new ListAppProfilesRequest instance using the specified properties. + * 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; + + /** + * Creates a new Instance instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static - * @param {google.bigtable.admin.v2.IListAppProfilesRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest instance + * @param {google.bigtable.admin.v2.IInstance=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Instance} Instance instance */ - ListAppProfilesRequest.create = function create(properties) { - return new ListAppProfilesRequest(properties); + Instance.create = function create(properties) { + return new Instance(properties); }; /** - * Encodes the specified ListAppProfilesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * Encodes the specified Instance message. Does not implicitly {@link google.bigtable.admin.v2.Instance.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static - * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @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 */ - ListAppProfilesRequest.encode = function encode(message, writer) { + Instance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.labels != null && message.hasOwnProperty("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(); return writer; }; /** - * Encodes the specified ListAppProfilesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesRequest.verify|verify} messages. + * 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.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static - * @param {google.bigtable.admin.v2.IListAppProfilesRequest} message ListAppProfilesRequest message or plain object to encode + * @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 */ - ListAppProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + Instance.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAppProfilesRequest message from the specified reader or buffer. + * Decodes an Instance message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @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.ListAppProfilesRequest} ListAppProfilesRequest + * @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 */ - ListAppProfilesRequest.decode = function decode(reader, length) { + Instance.decode = function decode(reader, length) { 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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Instance(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.state = reader.int32(); break; - case 2: - message.pageToken = reader.string(); + case 4: + message.type = reader.int32(); + break; + case 5: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -6654,128 +5896,227 @@ }; /** - * Decodes a ListAppProfilesRequest message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @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 */ - ListAppProfilesRequest.decodeDelimited = function decodeDelimited(reader) { + Instance.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAppProfilesRequest message. + * Verifies an Instance message. * @function verify - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @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 */ - ListAppProfilesRequest.verify = function verify(message) { + Instance.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.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"; + } return null; }; /** - * Creates a ListAppProfilesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListAppProfilesRequest} ListAppProfilesRequest + * @returns {google.bigtable.admin.v2.Instance} Instance */ - ListAppProfilesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesRequest) + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Instance) 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); + 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) { + 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) { + 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]]); + } return message; }; /** - * Creates a plain object from a ListAppProfilesRequest message. Also converts values to other types if specified. + * Creates a plain object from an Instance message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @static - * @param {google.bigtable.admin.v2.ListAppProfilesRequest} message ListAppProfilesRequest + * @param {google.bigtable.admin.v2.Instance} message Instance * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAppProfilesRequest.toObject = function toObject(message, options) { + Instance.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.parent = ""; - object.pageToken = ""; - object.pageSize = 0; + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + 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] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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.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. + * Converts this Instance to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListAppProfilesRequest + * @memberof google.bigtable.admin.v2.Instance * @instance * @returns {Object.} JSON object */ - ListAppProfilesRequest.prototype.toJSON = function toJSON() { + Instance.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAppProfilesRequest; + /** + * State enum. + * @name google.bigtable.admin.v2.Instance.State + * @enum {string} + * @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 {string} + * @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.ListAppProfilesResponse = (function() { + v2.Cluster = (function() { /** - * Properties of a ListAppProfilesResponse. + * Properties of a Cluster. * @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 + * @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.StorageType|null} [defaultStorageType] Cluster defaultStorageType */ /** - * Constructs a new ListAppProfilesResponse. + * Constructs a new Cluster. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListAppProfilesResponse. - * @implements IListAppProfilesResponse + * @classdesc Represents a Cluster. + * @implements ICluster * @constructor - * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set */ - function ListAppProfilesResponse(properties) { - this.appProfiles = []; - this.failedLocations = []; + function Cluster(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6783,107 +6124,127 @@ } /** - * ListAppProfilesResponse appProfiles. - * @member {Array.} appProfiles - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * Cluster name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Cluster * @instance */ - ListAppProfilesResponse.prototype.appProfiles = $util.emptyArray; + Cluster.prototype.name = ""; /** - * ListAppProfilesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * Cluster location. + * @member {string} location + * @memberof google.bigtable.admin.v2.Cluster * @instance */ - ListAppProfilesResponse.prototype.nextPageToken = ""; + Cluster.prototype.location = ""; /** - * ListAppProfilesResponse failedLocations. - * @member {Array.} failedLocations - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * Cluster state. + * @member {google.bigtable.admin.v2.Cluster.State} state + * @memberof google.bigtable.admin.v2.Cluster * @instance */ - ListAppProfilesResponse.prototype.failedLocations = $util.emptyArray; + Cluster.prototype.state = 0; /** - * Creates a new ListAppProfilesResponse instance using the specified properties. + * Cluster serveNodes. + * @member {number} serveNodes + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.serveNodes = 0; + + /** + * Cluster defaultStorageType. + * @member {google.bigtable.admin.v2.StorageType} defaultStorageType + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.defaultStorageType = 0; + + /** + * Creates a new Cluster instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static - * @param {google.bigtable.admin.v2.IListAppProfilesResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse instance + * @param {google.bigtable.admin.v2.ICluster=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Cluster} Cluster instance */ - ListAppProfilesResponse.create = function create(properties) { - return new ListAppProfilesResponse(properties); + Cluster.create = function create(properties) { + return new Cluster(properties); }; /** - * Encodes the specified ListAppProfilesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * Encodes the specified Cluster message. Does not implicitly {@link google.bigtable.admin.v2.Cluster.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static - * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @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 */ - ListAppProfilesResponse.encode = function encode(message, writer) { + Cluster.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 && message.hasOwnProperty("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]); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.serveNodes); + if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.defaultStorageType); return writer; }; /** - * Encodes the specified ListAppProfilesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListAppProfilesResponse.verify|verify} messages. + * 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.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static - * @param {google.bigtable.admin.v2.IListAppProfilesResponse} message ListAppProfilesResponse message or plain object to encode + * @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 */ - ListAppProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + Cluster.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAppProfilesResponse message from the specified reader or buffer. + * Decodes a Cluster message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @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.ListAppProfilesResponse} ListAppProfilesResponse + * @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 */ - ListAppProfilesResponse.decode = function decode(reader, length) { + Cluster.decode = function decode(reader, length) { 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(); + 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(); 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())); + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.location = reader.string(); break; case 3: - if (!(message.failedLocations && message.failedLocations.length)) - message.failedLocations = []; - message.failedLocations.push(reader.string()); + message.state = reader.int32(); + break; + case 4: + message.serveNodes = reader.int32(); + break; + case 5: + message.defaultStorageType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -6894,156 +6255,210 @@ }; /** - * Decodes a ListAppProfilesResponse message from the specified reader or buffer, length delimited. + * Decodes a Cluster message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @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 */ - ListAppProfilesResponse.decodeDelimited = function decodeDelimited(reader) { + Cluster.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAppProfilesResponse message. + * Verifies a Cluster message. * @function verify - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @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 */ - ListAppProfilesResponse.verify = function verify(message) { + Cluster.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.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.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) + switch (message.defaultStorageType) { + default: + return "defaultStorageType: enum value expected"; + case 0: + case 1: + case 2: + break; } - } - 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. + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListAppProfilesResponse} ListAppProfilesResponse + * @returns {google.bigtable.admin.v2.Cluster} Cluster */ - ListAppProfilesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListAppProfilesResponse) + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Cluster) 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]); - } + 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) { + 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.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]); + if (object.serveNodes != null) + message.serveNodes = object.serveNodes | 0; + switch (object.defaultStorageType) { + 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; } return message; }; /** - * Creates a plain object from a ListAppProfilesResponse message. Also converts values to other types if specified. + * Creates a plain object from a Cluster message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @static - * @param {google.bigtable.admin.v2.ListAppProfilesResponse} message ListAppProfilesResponse + * @param {google.bigtable.admin.v2.Cluster} message Cluster * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAppProfilesResponse.toObject = function toObject(message, options) { + Cluster.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]; + 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; } + 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] : 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] : message.defaultStorageType; return object; }; /** - * Converts this ListAppProfilesResponse to JSON. + * Converts this Cluster to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListAppProfilesResponse + * @memberof google.bigtable.admin.v2.Cluster * @instance * @returns {Object.} JSON object */ - ListAppProfilesResponse.prototype.toJSON = function toJSON() { + Cluster.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAppProfilesResponse; + /** + * State enum. + * @name google.bigtable.admin.v2.Cluster.State + * @enum {string} + * @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; + })(); + + return Cluster; })(); - v2.UpdateAppProfileRequest = (function() { + v2.AppProfile = (function() { /** - * Properties of an UpdateAppProfileRequest. + * Properties of an AppProfile. * @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 + * @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 */ /** - * Constructs a new UpdateAppProfileRequest. + * Constructs a new AppProfile. * @memberof google.bigtable.admin.v2 - * @classdesc Represents an UpdateAppProfileRequest. - * @implements IUpdateAppProfileRequest + * @classdesc Represents an AppProfile. + * @implements IAppProfile * @constructor - * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set */ - function UpdateAppProfileRequest(properties) { + function AppProfile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7051,101 +6466,141 @@ } /** - * UpdateAppProfileRequest appProfile. - * @member {google.bigtable.admin.v2.IAppProfile|null|undefined} appProfile - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * AppProfile name. + * @member {string} name + * @memberof google.bigtable.admin.v2.AppProfile * @instance */ - UpdateAppProfileRequest.prototype.appProfile = null; + AppProfile.prototype.name = ""; /** - * UpdateAppProfileRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * AppProfile etag. + * @member {string} etag + * @memberof google.bigtable.admin.v2.AppProfile * @instance */ - UpdateAppProfileRequest.prototype.updateMask = null; + AppProfile.prototype.etag = ""; /** - * UpdateAppProfileRequest ignoreWarnings. - * @member {boolean} ignoreWarnings - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * AppProfile description. + * @member {string} description + * @memberof google.bigtable.admin.v2.AppProfile * @instance */ - UpdateAppProfileRequest.prototype.ignoreWarnings = false; + AppProfile.prototype.description = ""; /** - * Creates a new UpdateAppProfileRequest instance using the specified properties. + * 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; + + // 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) + }); + + /** + * Creates a new AppProfile instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static - * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest instance + * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile instance */ - UpdateAppProfileRequest.create = function create(properties) { - return new UpdateAppProfileRequest(properties); + AppProfile.create = function create(properties) { + return new AppProfile(properties); }; /** - * Encodes the specified UpdateAppProfileRequest message. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static - * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @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 */ - UpdateAppProfileRequest.encode = function encode(message, writer) { + AppProfile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.appProfile != null && message.hasOwnProperty("appProfile")) - $root.google.bigtable.admin.v2.AppProfile.encode(message.appProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreWarnings); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.encode(message.multiClusterRoutingUseAny, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) + $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.encode(message.singleClusterRouting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateAppProfileRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.UpdateAppProfileRequest.verify|verify} messages. + * 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.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static - * @param {google.bigtable.admin.v2.IUpdateAppProfileRequest} message UpdateAppProfileRequest message or plain object to encode + * @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 */ - UpdateAppProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + AppProfile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateAppProfileRequest message from the specified reader or buffer. + * Decodes an AppProfile message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @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.UpdateAppProfileRequest} UpdateAppProfileRequest + * @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 */ - UpdateAppProfileRequest.decode = function decode(reader, length) { + AppProfile.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.appProfile = $root.google.bigtable.admin.v2.AppProfile.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.etag = reader.string(); break; case 3: - message.ignoreWarnings = reader.bool(); + 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; default: reader.skipType(tag & 7); @@ -7156,1216 +6611,1116 @@ }; /** - * Decodes an UpdateAppProfileRequest message from the specified reader or buffer, length delimited. + * Decodes an AppProfile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @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 */ - UpdateAppProfileRequest.decodeDelimited = function decodeDelimited(reader) { + AppProfile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateAppProfileRequest message. + * Verifies an AppProfile message. * @function verify - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @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 */ - UpdateAppProfileRequest.verify = function verify(message) { + AppProfile.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; + 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.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + 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.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. + * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.UpdateAppProfileRequest} UpdateAppProfileRequest + * @returns {google.bigtable.admin.v2.AppProfile} AppProfile */ - UpdateAppProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.UpdateAppProfileRequest) + AppProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile) 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); + 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.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.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); } - 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. + * Creates a plain object from an AppProfile message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.UpdateAppProfileRequest + * @memberof google.bigtable.admin.v2.AppProfile * @static - * @param {google.bigtable.admin.v2.UpdateAppProfileRequest} message UpdateAppProfileRequest + * @param {google.bigtable.admin.v2.AppProfile} message AppProfile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateAppProfileRequest.toObject = function toObject(message, options) { + AppProfile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.appProfile = null; - object.updateMask = null; - object.ignoreWarnings = false; + object.name = ""; + object.etag = ""; + object.description = ""; } - 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 + 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"; + } + return object; + }; + + /** + * Converts this AppProfile to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile + * @instance * @returns {Object.} JSON object */ - UpdateAppProfileRequest.prototype.toJSON = function toJSON() { + AppProfile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateAppProfileRequest; - })(); + AppProfile.MultiClusterRoutingUseAny = (function() { - v2.DeleteAppProfileRequest = (function() { + /** + * Properties of a MultiClusterRoutingUseAny. + * @memberof google.bigtable.admin.v2.AppProfile + * @interface IMultiClusterRoutingUseAny + */ - /** - * 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 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) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new 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]]; - } + /** + * 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); + }; - /** - * DeleteAppProfileRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest - * @instance - */ - DeleteAppProfileRequest.prototype.name = ""; + /** + * 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(); + return writer; + }; - /** - * DeleteAppProfileRequest ignoreWarnings. - * @member {boolean} ignoreWarnings - * @memberof google.bigtable.admin.v2.DeleteAppProfileRequest - * @instance - */ - DeleteAppProfileRequest.prototype.ignoreWarnings = false; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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 && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ignoreWarnings != null && message.hasOwnProperty("ignoreWarnings")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreWarnings); - return writer; - }; + /** + * 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()); + }; - /** - * 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(); - }; + /** + * 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"; + return null; + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.ignoreWarnings = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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; + return new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + }; + + /** + * 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() { + return {}; + }; + + /** + * 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); + }; + + 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]]; } - 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()); - }; + /** + * SingleClusterRouting clusterId. + * @member {string} clusterId + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.clusterId = ""; - /** - * 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; - }; + /** + * SingleClusterRouting allowTransactionalWrites. + * @member {boolean} allowTransactionalWrites + * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @instance + */ + SingleClusterRouting.prototype.allowTransactionalWrites = false; - /** - * 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) + /** + * 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 && message.hasOwnProperty("clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.allowTransactionalWrites != null && message.hasOwnProperty("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) { + 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(); + 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; - 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 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); + }; - /** - * 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); - }; + return SingleClusterRouting; + })(); - return DeleteAppProfileRequest; + return AppProfile; })(); - v2.UpdateAppProfileMetadata = (function() { + /** + * StorageType enum. + * @name google.bigtable.admin.v2.StorageType + * @enum {string} + * @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; + })(); - /** - * Properties of an UpdateAppProfileMetadata. - * @memberof google.bigtable.admin.v2 - * @interface IUpdateAppProfileMetadata - */ + v2.BigtableTableAdmin = (function() { /** - * Constructs a new UpdateAppProfileMetadata. + * Constructs a new BigtableTableAdmin service. * @memberof google.bigtable.admin.v2 - * @classdesc Represents an UpdateAppProfileMetadata. - * @implements IUpdateAppProfileMetadata + * @classdesc Represents a BigtableTableAdmin + * @extends $protobuf.rpc.Service * @constructor - * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function 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]]; + function BigtableTableAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (BigtableTableAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigtableTableAdmin; + /** - * Creates a new UpdateAppProfileMetadata instance using the specified properties. + * Creates new BigtableTableAdmin service using the specified rpc implementation. * @function create - * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * @memberof google.bigtable.admin.v2.BigtableTableAdmin * @static - * @param {google.bigtable.admin.v2.IUpdateAppProfileMetadata=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.UpdateAppProfileMetadata} UpdateAppProfileMetadata instance + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {BigtableTableAdmin} RPC service. Useful where requests and/or responses are streamed. */ - UpdateAppProfileMetadata.create = function create(properties) { - return new UpdateAppProfileMetadata(properties); + BigtableTableAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * 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 + * 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 */ - 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 + * 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 */ - UpdateAppProfileMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + 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" }); /** - * 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 + * 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 */ - UpdateAppProfileMetadata.decode = function decode(reader, length) { - 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(); - 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 + * 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 */ - 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 + * 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 */ - UpdateAppProfileMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - UpdateAppProfileMetadata.toObject = function toObject() { - return {}; - }; /** - * Converts this UpdateAppProfileMetadata to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.UpdateAppProfileMetadata + * Calls GetTable. + * @function getTable + * @memberof google.bigtable.admin.v2.BigtableTableAdmin * @instance - * @returns {Object.} JSON object + * @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 */ - UpdateAppProfileMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateAppProfileMetadata; - })(); - - v2.Instance = (function() { + 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" }); /** - * 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 + * 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 */ /** - * 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 + * 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 */ - function Instance(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]]; - } /** - * Instance name. - * @member {string} name - * @memberof google.bigtable.admin.v2.Instance + * 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 */ - Instance.prototype.name = ""; + 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" }); /** - * Instance displayName. - * @member {string} displayName - * @memberof google.bigtable.admin.v2.Instance + * 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 */ - Instance.prototype.displayName = ""; /** - * Instance state. - * @member {google.bigtable.admin.v2.Instance.State} state - * @memberof google.bigtable.admin.v2.Instance - * @instance + * 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 */ - Instance.prototype.state = 0; /** - * Instance type. - * @member {google.bigtable.admin.v2.Instance.Type} type - * @memberof google.bigtable.admin.v2.Instance + * 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 */ - Instance.prototype.type = 0; + 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" }); /** - * Instance labels. - * @member {Object.} labels - * @memberof google.bigtable.admin.v2.Instance + * 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 */ - Instance.prototype.labels = $util.emptyObject; /** - * 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 + * 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 */ - 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 + * 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 */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); - if (message.labels != null && message.hasOwnProperty("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(); - return writer; - }; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - Instance.decode = function decode(reader, length) { - 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; - while (reader.pos < end) { - var tag = reader.uint32(); - 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: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - 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 + * 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 */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + 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" }); /** - * 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 + * 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 */ - Instance.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.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"; - } - 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 + * 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 */ - 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) { - 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) { - 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]]); - } - 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 + * 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 */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_NOT_KNOWN" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - } - 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] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $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]]; - } - return object; - }; + 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" }); /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.Instance + * Calls CheckConsistency. + * @function checkConsistency + * @memberof google.bigtable.admin.v2.BigtableTableAdmin * @instance - * @returns {Object.} JSON object + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} request CheckConsistencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * State enum. - * @name google.bigtable.admin.v2.Instance.State - * @enum {string} - * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value + * 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 */ - 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 {string} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PRODUCTION=1 PRODUCTION value - * @property {number} DEVELOPMENT=2 DEVELOPMENT value + * 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 */ - 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.Cluster = (function() { + 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" }); /** - * 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.StorageType|null} [defaultStorageType] Cluster defaultStorageType + * 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 */ /** - * 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 + * 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 */ - 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 + * 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 */ - Cluster.prototype.name = ""; + 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" }); /** - * Cluster location. - * @member {string} location - * @memberof google.bigtable.admin.v2.Cluster + * 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 */ - Cluster.prototype.location = ""; /** - * Cluster state. - * @member {google.bigtable.admin.v2.Cluster.State} state - * @memberof google.bigtable.admin.v2.Cluster + * 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 */ - Cluster.prototype.state = 0; + 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" }); /** - * Cluster serveNodes. - * @member {number} serveNodes - * @memberof google.bigtable.admin.v2.Cluster + * 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 */ - Cluster.prototype.serveNodes = 0; /** - * Cluster defaultStorageType. - * @member {google.bigtable.admin.v2.StorageType} defaultStorageType - * @memberof google.bigtable.admin.v2.Cluster + * 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 */ - Cluster.prototype.defaultStorageType = 0; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - Cluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.location != null && message.hasOwnProperty("location")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.serveNodes); - if (message.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.defaultStorageType); - 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 + * 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 */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + 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" }); /** - * 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 + * 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 */ - Cluster.decode = function decode(reader, length) { - 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(); - 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 5: - message.defaultStorageType = reader.int32(); - 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 + * 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 */ - 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 + * 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 */ - Cluster.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.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.defaultStorageType != null && message.hasOwnProperty("defaultStorageType")) - switch (message.defaultStorageType) { - default: - return "defaultStorageType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + 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" }); /** - * 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 + * 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 */ - 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) { - 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.defaultStorageType) { - 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; - } - 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 + * 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 */ - 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; - } - 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] : 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] : message.defaultStorageType; - return object; - }; /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.Cluster + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.bigtable.admin.v2.BigtableTableAdmin * @instance - * @returns {Object.} JSON object + * @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 */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + 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" }); /** - * State enum. - * @name google.bigtable.admin.v2.Cluster.State - * @enum {string} - * @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 + * 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 */ - 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; - })(); - return Cluster; + return BigtableTableAdmin; })(); - v2.AppProfile = (function() { + v2.CreateTableRequest = (function() { /** - * Properties of an AppProfile. + * Properties of a CreateTableRequest. * @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 + * @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 AppProfile. + * Constructs a new CreateTableRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents an AppProfile. - * @implements IAppProfile + * @classdesc Represents a CreateTableRequest. + * @implements ICreateTableRequest * @constructor - * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set */ - function AppProfile(properties) { + function CreateTableRequest(properties) { + this.initialSplits = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8373,141 +7728,117 @@ } /** - * 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 + * CreateTableRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableRequest * @instance */ - AppProfile.prototype.description = ""; + CreateTableRequest.prototype.parent = ""; /** - * AppProfile multiClusterRoutingUseAny. - * @member {google.bigtable.admin.v2.AppProfile.IMultiClusterRoutingUseAny|null|undefined} multiClusterRoutingUseAny - * @memberof google.bigtable.admin.v2.AppProfile + * CreateTableRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableRequest * @instance */ - AppProfile.prototype.multiClusterRoutingUseAny = null; + CreateTableRequest.prototype.tableId = ""; /** - * AppProfile singleClusterRouting. - * @member {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting|null|undefined} singleClusterRouting - * @memberof google.bigtable.admin.v2.AppProfile + * CreateTableRequest table. + * @member {google.bigtable.admin.v2.ITable|null|undefined} table + * @memberof google.bigtable.admin.v2.CreateTableRequest * @instance */ - AppProfile.prototype.singleClusterRouting = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateTableRequest.prototype.table = null; /** - * AppProfile routingPolicy. - * @member {"multiClusterRoutingUseAny"|"singleClusterRouting"|undefined} routingPolicy - * @memberof google.bigtable.admin.v2.AppProfile + * CreateTableRequest initialSplits. + * @member {Array.} initialSplits + * @memberof google.bigtable.admin.v2.CreateTableRequest * @instance */ - Object.defineProperty(AppProfile.prototype, "routingPolicy", { - get: $util.oneOfGetter($oneOfFields = ["multiClusterRoutingUseAny", "singleClusterRouting"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateTableRequest.prototype.initialSplits = $util.emptyArray; /** - * Creates a new AppProfile instance using the specified properties. + * Creates a new CreateTableRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static - * @param {google.bigtable.admin.v2.IAppProfile=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.AppProfile} AppProfile instance + * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest instance */ - AppProfile.create = function create(properties) { - return new AppProfile(properties); + CreateTableRequest.create = function create(properties) { + return new CreateTableRequest(properties); }; /** - * Encodes the specified AppProfile message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static - * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @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 */ - AppProfile.encode = function encode(message, writer) { + CreateTableRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && message.hasOwnProperty("etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.multiClusterRoutingUseAny != null && message.hasOwnProperty("multiClusterRoutingUseAny")) - $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.encode(message.multiClusterRoutingUseAny, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.singleClusterRouting != null && message.hasOwnProperty("singleClusterRouting")) - $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.encode(message.singleClusterRouting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && message.hasOwnProperty("tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.table != null && message.hasOwnProperty("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 AppProfile message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.verify|verify} messages. + * 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.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static - * @param {google.bigtable.admin.v2.IAppProfile} message AppProfile message or plain object to encode + * @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 */ - AppProfile.encodeDelimited = function encodeDelimited(message, writer) { + CreateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppProfile message from the specified reader or buffer. + * Decodes a CreateTableRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.AppProfile + * @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.AppProfile} AppProfile + * @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 */ - AppProfile.decode = function decode(reader, length) { + CreateTableRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.etag = reader.string(); + message.tableId = 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()); + message.table = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); break; - case 6: - message.singleClusterRouting = $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.decode(reader, reader.uint32()); + 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); @@ -8518,321 +7849,152 @@ }; /** - * Decodes an AppProfile message from the specified reader or buffer, length delimited. + * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @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 */ - AppProfile.decodeDelimited = function decodeDelimited(reader) { + CreateTableRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppProfile message. + * Verifies a CreateTableRequest message. * @function verify - * @memberof google.bigtable.admin.v2.AppProfile + * @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 */ - AppProfile.verify = function verify(message) { + CreateTableRequest.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.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.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 (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 "singleClusterRouting." + error; + return "initialSplits." + error; } } return null; }; /** - * Creates an AppProfile message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.AppProfile} AppProfile + * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest */ - AppProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.AppProfile) + CreateTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest) 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); + 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.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); + 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 an AppProfile message. Also converts values to other types if specified. + * Creates a plain object from a CreateTableRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @static - * @param {google.bigtable.admin.v2.AppProfile} message AppProfile + * @param {google.bigtable.admin.v2.CreateTableRequest} message CreateTableRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppProfile.toObject = function toObject(message, options) { + CreateTableRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.initialSplits = []; 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"; + object.parent = ""; + object.tableId = ""; + object.table = null; } - 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.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 AppProfile to JSON. + * Converts this CreateTableRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.AppProfile + * @memberof google.bigtable.admin.v2.CreateTableRequest * @instance * @returns {Object.} JSON object */ - AppProfile.prototype.toJSON = function toJSON() { + CreateTableRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - AppProfile.MultiClusterRoutingUseAny = (function() { - - /** - * Properties of a MultiClusterRoutingUseAny. - * @memberof google.bigtable.admin.v2.AppProfile - * @interface IMultiClusterRoutingUseAny - */ - - /** - * 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) { - if (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 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(); - 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) { - 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(); - switch (tag >>> 3) { - 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"; - 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; - return new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); - }; - - /** - * 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() { - return {}; - }; - - /** - * 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); - }; - - return MultiClusterRoutingUseAny; - })(); - - AppProfile.SingleClusterRouting = (function() { + CreateTableRequest.Split = (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 + * Properties of a Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @interface ISplit + * @property {Uint8Array|null} [key] Split key */ /** - * Constructs a new SingleClusterRouting. - * @memberof google.bigtable.admin.v2.AppProfile - * @classdesc Represents a SingleClusterRouting. - * @implements ISingleClusterRouting + * Constructs a new Split. + * @memberof google.bigtable.admin.v2.CreateTableRequest + * @classdesc Represents a Split. + * @implements ISplit * @constructor - * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set */ - function SingleClusterRouting(properties) { + function Split(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8840,88 +8002,75 @@ } /** - * 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 + * Split key. + * @member {Uint8Array} key + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @instance */ - SingleClusterRouting.prototype.allowTransactionalWrites = false; + Split.prototype.key = $util.newBuffer([]); /** - * Creates a new SingleClusterRouting instance using the specified properties. + * Creates a new Split instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static - * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting instance + * @param {google.bigtable.admin.v2.CreateTableRequest.ISplit=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split instance */ - SingleClusterRouting.create = function create(properties) { - return new SingleClusterRouting(properties); + Split.create = function create(properties) { + return new Split(properties); }; /** - * Encodes the specified SingleClusterRouting message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * 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.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static - * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @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 */ - SingleClusterRouting.encode = function encode(message, writer) { + Split.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); - if (message.allowTransactionalWrites != null && message.hasOwnProperty("allowTransactionalWrites")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowTransactionalWrites); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); return writer; }; /** - * Encodes the specified SingleClusterRouting message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.SingleClusterRouting.verify|verify} messages. + * 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.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static - * @param {google.bigtable.admin.v2.AppProfile.ISingleClusterRouting} message SingleClusterRouting message or plain object to encode + * @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 */ - SingleClusterRouting.encodeDelimited = function encodeDelimited(message, writer) { + Split.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SingleClusterRouting message from the specified reader or buffer. + * Decodes a Split message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @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.AppProfile.SingleClusterRouting} SingleClusterRouting + * @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 */ - SingleClusterRouting.decode = function decode(reader, length) { + Split.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); - break; - case 2: - message.allowTransactionalWrites = reader.bool(); + message.key = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -8932,686 +8081,894 @@ }; /** - * Decodes a SingleClusterRouting message from the specified reader or buffer, length delimited. + * Decodes a Split message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @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 */ - SingleClusterRouting.decodeDelimited = function decodeDelimited(reader) { + Split.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SingleClusterRouting message. + * Verifies a Split message. * @function verify - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @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 */ - SingleClusterRouting.verify = function verify(message) { + Split.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"; + 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 SingleClusterRouting message from a plain object. Also converts values to their respective internal types. + * Creates a Split message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} SingleClusterRouting + * @returns {google.bigtable.admin.v2.CreateTableRequest.Split} Split */ - SingleClusterRouting.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + 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.AppProfile.SingleClusterRouting(); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.allowTransactionalWrites != null) - message.allowTransactionalWrites = Boolean(object.allowTransactionalWrites); + 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) + message.key = object.key; return message; }; /** - * Creates a plain object from a SingleClusterRouting message. Also converts values to other types if specified. + * Creates a plain object from a Split message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @static - * @param {google.bigtable.admin.v2.AppProfile.SingleClusterRouting} message SingleClusterRouting + * @param {google.bigtable.admin.v2.CreateTableRequest.Split} message Split * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SingleClusterRouting.toObject = function toObject(message, options) { + Split.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; + 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 SingleClusterRouting to JSON. + * Converts this Split to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.AppProfile.SingleClusterRouting + * @memberof google.bigtable.admin.v2.CreateTableRequest.Split * @instance * @returns {Object.} JSON object */ - SingleClusterRouting.prototype.toJSON = function toJSON() { + Split.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SingleClusterRouting; + return Split; })(); - return AppProfile; + return CreateTableRequest; })(); - v2.BigtableTableAdmin = (function() { + v2.CreateTableFromSnapshotRequest = (function() { /** - * Constructs a new BigtableTableAdmin service. + * Properties of a CreateTableFromSnapshotRequest. * @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. + * @interface ICreateTableFromSnapshotRequest + * @property {string|null} [parent] CreateTableFromSnapshotRequest parent + * @property {string|null} [tableId] CreateTableFromSnapshotRequest tableId + * @property {string|null} [sourceSnapshot] CreateTableFromSnapshotRequest sourceSnapshot */ - 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 + * 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]]; + } /** - * Calls CreateTable. - * @function createTable - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * CreateTableFromSnapshotRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest * @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" }); + CreateTableFromSnapshotRequest.prototype.parent = ""; /** - * Calls CreateTable. - * @function createTable - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * CreateTableFromSnapshotRequest tableId. + * @member {string} tableId + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest * @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 */ + CreateTableFromSnapshotRequest.prototype.tableId = ""; /** - * Calls CreateTableFromSnapshot. - * @function createTableFromSnapshot - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * CreateTableFromSnapshotRequest sourceSnapshot. + * @member {string} sourceSnapshot + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest * @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" }); + CreateTableFromSnapshotRequest.prototype.sourceSnapshot = ""; /** - * 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 + * 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); + }; /** - * 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 + * 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tableId != null && message.hasOwnProperty("tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceSnapshot); + return writer; + }; /** - * 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 + * 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 */ - 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" }); + CreateTableFromSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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()); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * Calls DeleteTable. - * @function deleteTable - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * Converts this CreateTableFromSnapshotRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest * @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 + * @returns {Object.} JSON object */ - 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" }); + CreateTableFromSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 - */ + return CreateTableFromSnapshotRequest; + })(); - /** - * 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 - */ + v2.DropRowRangeRequest = (function() { /** - * 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 + * 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 */ - 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 + * 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]]; + } /** - * 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 + * DropRowRangeRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @instance */ + DropRowRangeRequest.prototype.name = ""; /** - * Calls DropRowRange. - * @function dropRowRange - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * DropRowRangeRequest rowKeyPrefix. + * @member {Uint8Array} rowKeyPrefix + * @memberof google.bigtable.admin.v2.DropRowRangeRequest * @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" }); + DropRowRangeRequest.prototype.rowKeyPrefix = $util.newBuffer([]); /** - * Calls DropRowRange. - * @function dropRowRange - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * DropRowRangeRequest deleteAllDataFromTable. + * @member {boolean} deleteAllDataFromTable + * @memberof google.bigtable.admin.v2.DropRowRangeRequest * @instance - * @param {google.bigtable.admin.v2.IDropRowRangeRequest} request DropRowRangeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DropRowRangeRequest.prototype.deleteAllDataFromTable = false; - /** - * 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 - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls GenerateConsistencyToken. - * @function generateConsistencyToken - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * DropRowRangeRequest target. + * @member {"rowKeyPrefix"|"deleteAllDataFromTable"|undefined} target + * @memberof google.bigtable.admin.v2.DropRowRangeRequest * @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" }); + Object.defineProperty(DropRowRangeRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["rowKeyPrefix", "deleteAllDataFromTable"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * 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 + * 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); + }; /** - * 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 + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKeyPrefix); + if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteAllDataFromTable); + return writer; + }; /** - * 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 + * 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 */ - 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" }); + DropRowRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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()); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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) + message.rowKeyPrefix = object.rowKeyPrefix; + if (object.deleteAllDataFromTable != null) + message.deleteAllDataFromTable = Boolean(object.deleteAllDataFromTable); + return message; + }; /** - * 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 + * 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; + }; /** - * Calls GetSnapshot. - * @function getSnapshot - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * Converts this DropRowRangeRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.DropRowRangeRequest * @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 + * @returns {Object.} JSON object */ - 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" }); + DropRowRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 - */ + return DropRowRangeRequest; + })(); + + v2.ListTablesRequest = (function() { /** - * 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 + * 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 */ /** - * 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 + * 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 */ - 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" }); + 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]]; + } /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * ListTablesRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListTablesRequest * @instance - * @param {google.bigtable.admin.v2.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListTablesRequest.prototype.parent = ""; /** - * 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 + * ListTablesRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.ListTablesRequest + * @instance */ + ListTablesRequest.prototype.view = 0; /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * ListTablesRequest pageSize. + * @member {number} pageSize + * @memberof google.bigtable.admin.v2.ListTablesRequest * @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" }); + ListTablesRequest.prototype.pageSize = 0; /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * ListTablesRequest pageToken. + * @member {string} pageToken + * @memberof google.bigtable.admin.v2.ListTablesRequest * @instance - * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListTablesRequest.prototype.pageToken = ""; /** - * 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 + * 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); + }; /** - * 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 + * 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 */ - 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" }); + ListTablesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; /** - * 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 + * 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(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - 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" }); + ListTablesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * 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 + * 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 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; + }; /** - * 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 + * 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) { + 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 "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; + }; /** - * 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 + * 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 */ - 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" }); + 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] : 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; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.bigtable.admin.v2.BigtableTableAdmin + * Converts this ListTablesRequest to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.ListTablesRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListTablesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BigtableTableAdmin; + return ListTablesRequest; })(); - v2.CreateTableRequest = (function() { + v2.ListTablesResponse = (function() { /** - * Properties of a CreateTableRequest. + * Properties of a ListTablesResponse. * @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 + * @interface IListTablesResponse + * @property {Array.|null} [tables] ListTablesResponse tables + * @property {string|null} [nextPageToken] ListTablesResponse nextPageToken */ /** - * Constructs a new CreateTableRequest. + * Constructs a new ListTablesResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateTableRequest. - * @implements ICreateTableRequest + * @classdesc Represents a ListTablesResponse. + * @implements IListTablesResponse * @constructor - * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set */ - function CreateTableRequest(properties) { - this.initialSplits = []; + function ListTablesResponse(properties) { + this.tables = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9619,117 +8976,91 @@ } /** - * 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 + * ListTablesResponse tables. + * @member {Array.} tables + * @memberof google.bigtable.admin.v2.ListTablesResponse * @instance */ - CreateTableRequest.prototype.table = null; + ListTablesResponse.prototype.tables = $util.emptyArray; /** - * CreateTableRequest initialSplits. - * @member {Array.} initialSplits - * @memberof google.bigtable.admin.v2.CreateTableRequest + * ListTablesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListTablesResponse * @instance */ - CreateTableRequest.prototype.initialSplits = $util.emptyArray; + ListTablesResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateTableRequest instance using the specified properties. + * Creates a new ListTablesResponse instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static - * @param {google.bigtable.admin.v2.ICreateTableRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest instance + * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse instance */ - CreateTableRequest.create = function create(properties) { - return new CreateTableRequest(properties); + ListTablesResponse.create = function create(properties) { + return new ListTablesResponse(properties); }; /** - * Encodes the specified CreateTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static - * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @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 */ - CreateTableRequest.encode = function encode(message, writer) { + ListTablesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.tableId != null && message.hasOwnProperty("tableId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); - if (message.table != null && message.hasOwnProperty("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(); + 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 && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableRequest.verify|verify} messages. + * 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.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static - * @param {google.bigtable.admin.v2.ICreateTableRequest} message CreateTableRequest message or plain object to encode + * @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 */ - CreateTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListTablesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTableRequest message from the specified reader or buffer. + * Decodes a ListTablesResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @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.CreateTableRequest} CreateTableRequest + * @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 */ - CreateTableRequest.decode = function decode(reader, length) { + ListTablesResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + 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.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())); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9740,353 +9071,371 @@ }; /** - * Decodes a CreateTableRequest message from the specified reader or buffer, length delimited. + * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @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 */ - CreateTableRequest.decodeDelimited = function decodeDelimited(reader) { + ListTablesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTableRequest message. + * Verifies a ListTablesResponse message. * @function verify - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @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 */ - CreateTableRequest.verify = function verify(message) { + ListTablesResponse.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 (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 "initialSplits." + error; + return "tables." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateTableRequest} CreateTableRequest + * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse */ - CreateTableRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateTableRequest) + ListTablesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListTablesResponse) 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]); + 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 CreateTableRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListTablesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @static - * @param {google.bigtable.admin.v2.CreateTableRequest} message CreateTableRequest + * @param {google.bigtable.admin.v2.ListTablesResponse} message ListTablesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTableRequest.toObject = function toObject(message, options) { + ListTablesResponse.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); + 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 CreateTableRequest to JSON. + * Converts this ListTablesResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateTableRequest + * @memberof google.bigtable.admin.v2.ListTablesResponse * @instance * @returns {Object.} JSON object */ - CreateTableRequest.prototype.toJSON = function toJSON() { + ListTablesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - CreateTableRequest.Split = (function() { + return ListTablesResponse; + })(); - /** - * Properties of a Split. - * @memberof google.bigtable.admin.v2.CreateTableRequest - * @interface ISplit - * @property {Uint8Array|null} [key] Split key - */ + v2.GetTableRequest = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * Split key. - * @member {Uint8Array} key - * @memberof google.bigtable.admin.v2.CreateTableRequest.Split - * @instance - */ - Split.prototype.key = $util.newBuffer([]); + /** + * 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]]; + } - /** - * 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); - }; + /** + * GetTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.name = ""; - /** - * 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 && message.hasOwnProperty("key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - return writer; - }; + /** + * GetTableRequest view. + * @member {google.bigtable.admin.v2.Table.View} view + * @memberof google.bigtable.admin.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.view = 0; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; - /** - * 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()); - }; + /** + * 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(); + }; - /** - * 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; - }; + /** + * 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) { + 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(); + 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()); + }; - /** - * 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) - message.key = object.key; - return message; - }; + /** + * 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 4: + break; + } + return null; + }; - /** - * 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; + /** + * 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) { + 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 "FULL": + case 4: + message.view = 4; + break; + } + return message; + }; - /** - * 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); - }; + /** + * 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] : message.view; + return object; + }; - return Split; - })(); + /** + * 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); + }; - return CreateTableRequest; + return GetTableRequest; })(); - v2.CreateTableFromSnapshotRequest = (function() { + v2.DeleteTableRequest = (function() { /** - * Properties of a CreateTableFromSnapshotRequest. + * Properties of a DeleteTableRequest. * @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 + * @interface IDeleteTableRequest + * @property {string|null} [name] DeleteTableRequest name */ /** - * Constructs a new CreateTableFromSnapshotRequest. + * Constructs a new DeleteTableRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateTableFromSnapshotRequest. - * @implements ICreateTableFromSnapshotRequest + * @classdesc Represents a DeleteTableRequest. + * @implements IDeleteTableRequest * @constructor - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set */ - function CreateTableFromSnapshotRequest(properties) { + function DeleteTableRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10094,101 +9443,75 @@ } /** - * 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 + * DeleteTableRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @instance */ - CreateTableFromSnapshotRequest.prototype.sourceSnapshot = ""; + DeleteTableRequest.prototype.name = ""; /** - * Creates a new CreateTableFromSnapshotRequest instance using the specified properties. + * Creates a new DeleteTableRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest instance + * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest instance */ - CreateTableFromSnapshotRequest.create = function create(properties) { - return new CreateTableFromSnapshotRequest(properties); + DeleteTableRequest.create = function create(properties) { + return new DeleteTableRequest(properties); }; /** - * Encodes the specified CreateTableFromSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @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 */ - CreateTableFromSnapshotRequest.encode = function encode(message, writer) { + DeleteTableRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.tableId != null && message.hasOwnProperty("tableId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); - if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceSnapshot); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateTableFromSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest.verify|verify} messages. + * 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.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest message or plain object to encode + * @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 */ - CreateTableFromSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer. + * Decodes a DeleteTableRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @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.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @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 */ - CreateTableFromSnapshotRequest.decode = function decode(reader, length) { + DeleteTableRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.tableId = reader.string(); - break; - case 3: - message.sourceSnapshot = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -10199,126 +9522,109 @@ }; /** - * Decodes a CreateTableFromSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @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 */ - CreateTableFromSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTableFromSnapshotRequest message. + * Verifies a DeleteTableRequest message. * @function verify - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @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 */ - CreateTableFromSnapshotRequest.verify = function verify(message) { + DeleteTableRequest.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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateTableFromSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} CreateTableFromSnapshotRequest + * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest */ - CreateTableFromSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + DeleteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteTableRequest) 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); + 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 CreateTableFromSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @static - * @param {google.bigtable.admin.v2.CreateTableFromSnapshotRequest} message CreateTableFromSnapshotRequest + * @param {google.bigtable.admin.v2.DeleteTableRequest} message DeleteTableRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTableFromSnapshotRequest.toObject = function toObject(message, options) { + DeleteTableRequest.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; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateTableFromSnapshotRequest to JSON. + * Converts this DeleteTableRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotRequest + * @memberof google.bigtable.admin.v2.DeleteTableRequest * @instance * @returns {Object.} JSON object */ - CreateTableFromSnapshotRequest.prototype.toJSON = function toJSON() { + DeleteTableRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateTableFromSnapshotRequest; + return DeleteTableRequest; })(); - v2.DropRowRangeRequest = (function() { + v2.ModifyColumnFamiliesRequest = (function() { /** - * Properties of a DropRowRangeRequest. + * Properties of a ModifyColumnFamiliesRequest. * @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 + * @interface IModifyColumnFamiliesRequest + * @property {string|null} [name] ModifyColumnFamiliesRequest name + * @property {Array.|null} [modifications] ModifyColumnFamiliesRequest modifications */ /** - * Constructs a new DropRowRangeRequest. + * Constructs a new ModifyColumnFamiliesRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a DropRowRangeRequest. - * @implements IDropRowRangeRequest + * @classdesc Represents a ModifyColumnFamiliesRequest. + * @implements IModifyColumnFamiliesRequest * @constructor - * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set */ - function DropRowRangeRequest(properties) { + function ModifyColumnFamiliesRequest(properties) { + this.modifications = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10326,104 +9632,81 @@ } /** - * DropRowRangeRequest name. + * ModifyColumnFamiliesRequest name. * @member {string} name - * @memberof google.bigtable.admin.v2.DropRowRangeRequest - * @instance - */ - DropRowRangeRequest.prototype.name = ""; - - /** - * DropRowRangeRequest rowKeyPrefix. - * @member {Uint8Array} rowKeyPrefix - * @memberof google.bigtable.admin.v2.DropRowRangeRequest - * @instance - */ - DropRowRangeRequest.prototype.rowKeyPrefix = $util.newBuffer([]); - - /** - * DropRowRangeRequest deleteAllDataFromTable. - * @member {boolean} deleteAllDataFromTable - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @instance */ - DropRowRangeRequest.prototype.deleteAllDataFromTable = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ModifyColumnFamiliesRequest.prototype.name = ""; /** - * DropRowRangeRequest target. - * @member {"rowKeyPrefix"|"deleteAllDataFromTable"|undefined} target - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * ModifyColumnFamiliesRequest modifications. + * @member {Array.} modifications + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @instance */ - Object.defineProperty(DropRowRangeRequest.prototype, "target", { - get: $util.oneOfGetter($oneOfFields = ["rowKeyPrefix", "deleteAllDataFromTable"]), - set: $util.oneOfSetter($oneOfFields) - }); + ModifyColumnFamiliesRequest.prototype.modifications = $util.emptyArray; /** - * Creates a new DropRowRangeRequest instance using the specified properties. + * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static - * @param {google.bigtable.admin.v2.IDropRowRangeRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest instance + * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest instance */ - DropRowRangeRequest.create = function create(properties) { - return new DropRowRangeRequest(properties); + ModifyColumnFamiliesRequest.create = function create(properties) { + return new ModifyColumnFamiliesRequest(properties); }; /** - * Encodes the specified DropRowRangeRequest message. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static - * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @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 */ - DropRowRangeRequest.encode = function encode(message, writer) { + ModifyColumnFamiliesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.rowKeyPrefix != null && message.hasOwnProperty("rowKeyPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rowKeyPrefix); - if (message.deleteAllDataFromTable != null && message.hasOwnProperty("deleteAllDataFromTable")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteAllDataFromTable); + 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(); return writer; }; /** - * Encodes the specified DropRowRangeRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DropRowRangeRequest.verify|verify} messages. + * 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.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static - * @param {google.bigtable.admin.v2.IDropRowRangeRequest} message DropRowRangeRequest message or plain object to encode + * @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 */ - DropRowRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ModifyColumnFamiliesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DropRowRangeRequest message from the specified reader or buffer. + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @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.DropRowRangeRequest} DropRowRangeRequest + * @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 */ - DropRowRangeRequest.decode = function decode(reader, length) { + ModifyColumnFamiliesRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -10431,10 +9714,9 @@ message.name = reader.string(); break; case 2: - message.rowKeyPrefix = reader.bytes(); - break; - case 3: - message.deleteAllDataFromTable = reader.bool(); + if (!(message.modifications && message.modifications.length)) + message.modifications = []; + message.modifications.push($root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -10445,140 +9727,429 @@ }; /** - * Decodes a DropRowRangeRequest message from the specified reader or buffer, length delimited. + * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @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 */ - DropRowRangeRequest.decodeDelimited = function decodeDelimited(reader) { + ModifyColumnFamiliesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DropRowRangeRequest message. + * Verifies a ModifyColumnFamiliesRequest message. * @function verify - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @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 */ - DropRowRangeRequest.verify = function verify(message) { + ModifyColumnFamiliesRequest.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"; + 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; + } } return null; }; /** - * Creates a DropRowRangeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.DropRowRangeRequest} DropRowRangeRequest + * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest */ - DropRowRangeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.DropRowRangeRequest) + ModifyColumnFamiliesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) return object; - var message = new $root.google.bigtable.admin.v2.DropRowRangeRequest(); + var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); 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) - message.rowKeyPrefix = object.rowKeyPrefix; - if (object.deleteAllDataFromTable != null) - message.deleteAllDataFromTable = Boolean(object.deleteAllDataFromTable); + 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]); + } + } return message; }; /** - * Creates a plain object from a DropRowRangeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ModifyColumnFamiliesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @static - * @param {google.bigtable.admin.v2.DropRowRangeRequest} message DropRowRangeRequest + * @param {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DropRowRangeRequest.toObject = function toObject(message, options) { + ModifyColumnFamiliesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.modifications = []; 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"; + 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); } return object; }; /** - * Converts this DropRowRangeRequest to JSON. + * Converts this ModifyColumnFamiliesRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.DropRowRangeRequest + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest * @instance * @returns {Object.} JSON object */ - DropRowRangeRequest.prototype.toJSON = function toJSON() { + ModifyColumnFamiliesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DropRowRangeRequest; + 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 + */ + + /** + * 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} drop + * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + * @instance + */ + Modification.prototype.drop = false; + + // 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 && message.hasOwnProperty("id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.create != null && message.hasOwnProperty("create")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.create, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.update != null && message.hasOwnProperty("update")) + $root.google.bigtable.admin.v2.ColumnFamily.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.drop != null && message.hasOwnProperty("drop")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.drop); + 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) { + 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(); + 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; + 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"; + } + 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); + 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 = ""; + 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"; + } + 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); + }; + + return Modification; + })(); + + return ModifyColumnFamiliesRequest; })(); - v2.ListTablesRequest = (function() { + v2.GenerateConsistencyTokenRequest = (function() { /** - * Properties of a ListTablesRequest. + * Properties of a GenerateConsistencyTokenRequest. * @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 + * @interface IGenerateConsistencyTokenRequest + * @property {string|null} [name] GenerateConsistencyTokenRequest name */ /** - * Constructs a new ListTablesRequest. + * Constructs a new GenerateConsistencyTokenRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListTablesRequest. - * @implements IListTablesRequest + * @classdesc Represents a GenerateConsistencyTokenRequest. + * @implements IGenerateConsistencyTokenRequest * @constructor - * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set */ - function ListTablesRequest(properties) { + function GenerateConsistencyTokenRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10586,114 +10157,75 @@ } /** - * 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 + * GenerateConsistencyTokenRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @instance */ - ListTablesRequest.prototype.pageToken = ""; + GenerateConsistencyTokenRequest.prototype.name = ""; /** - * Creates a new ListTablesRequest instance using the specified properties. + * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static - * @param {google.bigtable.admin.v2.IListTablesRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest instance */ - ListTablesRequest.create = function create(properties) { - return new ListTablesRequest(properties); + GenerateConsistencyTokenRequest.create = function create(properties) { + return new GenerateConsistencyTokenRequest(properties); }; /** - * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static - * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @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 */ - ListTablesRequest.encode = function encode(message, writer) { + GenerateConsistencyTokenRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesRequest.verify|verify} messages. + * 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.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static - * @param {google.bigtable.admin.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @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 */ - ListTablesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GenerateConsistencyTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTablesRequest message from the specified reader or buffer. + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @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.ListTablesRequest} ListTablesRequest + * @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 */ - ListTablesRequest.decode = function decode(reader, length) { + GenerateConsistencyTokenRequest.decode = function decode(reader, length) { 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(); + 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(); 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(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -10704,162 +10236,107 @@ }; /** - * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @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 */ - ListTablesRequest.decodeDelimited = function decodeDelimited(reader) { + GenerateConsistencyTokenRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTablesRequest message. + * Verifies a GenerateConsistencyTokenRequest message. * @function verify - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @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 */ - ListTablesRequest.verify = function verify(message) { + GenerateConsistencyTokenRequest.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 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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListTablesRequest} ListTablesRequest + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest */ - 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) { - 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 "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); + 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 ListTablesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GenerateConsistencyTokenRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @static - * @param {google.bigtable.admin.v2.ListTablesRequest} message ListTablesRequest + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTablesRequest.toObject = function toObject(message, options) { + GenerateConsistencyTokenRequest.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] : message.view; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListTablesRequest to JSON. + * Converts this GenerateConsistencyTokenRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListTablesRequest + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest * @instance * @returns {Object.} JSON object */ - ListTablesRequest.prototype.toJSON = function toJSON() { + GenerateConsistencyTokenRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListTablesRequest; + return GenerateConsistencyTokenRequest; })(); - v2.ListTablesResponse = (function() { + v2.GenerateConsistencyTokenResponse = (function() { /** - * Properties of a ListTablesResponse. + * Properties of a GenerateConsistencyTokenResponse. * @memberof google.bigtable.admin.v2 - * @interface IListTablesResponse - * @property {Array.|null} [tables] ListTablesResponse tables - * @property {string|null} [nextPageToken] ListTablesResponse nextPageToken + * @interface IGenerateConsistencyTokenResponse + * @property {string|null} [consistencyToken] GenerateConsistencyTokenResponse consistencyToken */ /** - * Constructs a new ListTablesResponse. + * Constructs a new GenerateConsistencyTokenResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListTablesResponse. - * @implements IListTablesResponse + * @classdesc Represents a GenerateConsistencyTokenResponse. + * @implements IGenerateConsistencyTokenResponse * @constructor - * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set */ - function ListTablesResponse(properties) { - this.tables = []; + function GenerateConsistencyTokenResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10867,91 +10344,75 @@ } /** - * 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 + * GenerateConsistencyTokenResponse consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @instance */ - ListTablesResponse.prototype.nextPageToken = ""; + GenerateConsistencyTokenResponse.prototype.consistencyToken = ""; /** - * Creates a new ListTablesResponse instance using the specified properties. + * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static - * @param {google.bigtable.admin.v2.IListTablesResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse instance + * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse instance */ - ListTablesResponse.create = function create(properties) { - return new ListTablesResponse(properties); + GenerateConsistencyTokenResponse.create = function create(properties) { + return new GenerateConsistencyTokenResponse(properties); }; /** - * Encodes the specified ListTablesResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static - * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @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 */ - ListTablesResponse.encode = function encode(message, writer) { + GenerateConsistencyTokenResponse.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 && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consistencyToken); return writer; }; /** - * Encodes the specified ListTablesResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListTablesResponse.verify|verify} messages. + * 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.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static - * @param {google.bigtable.admin.v2.IListTablesResponse} message ListTablesResponse message or plain object to encode + * @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 */ - ListTablesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GenerateConsistencyTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTablesResponse message from the specified reader or buffer. + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @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.ListTablesResponse} ListTablesResponse + * @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 */ - ListTablesResponse.decode = function decode(reader, length) { + GenerateConsistencyTokenResponse.decode = function decode(reader, length) { 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(); + 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(); 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(); + message.consistencyToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -10962,134 +10423,108 @@ }; /** - * Decodes a ListTablesResponse message from the specified reader or buffer, length delimited. + * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @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 */ - ListTablesResponse.decodeDelimited = function decodeDelimited(reader) { + GenerateConsistencyTokenResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTablesResponse message. + * Verifies a GenerateConsistencyTokenResponse message. * @function verify - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @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 */ - ListTablesResponse.verify = function verify(message) { + GenerateConsistencyTokenResponse.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"; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; return null; }; /** - * Creates a ListTablesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListTablesResponse} ListTablesResponse + * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse */ - ListTablesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListTablesResponse) + GenerateConsistencyTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) 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); + 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 ListTablesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GenerateConsistencyTokenResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @static - * @param {google.bigtable.admin.v2.ListTablesResponse} message ListTablesResponse + * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTablesResponse.toObject = function toObject(message, options) { + GenerateConsistencyTokenResponse.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; + object.consistencyToken = ""; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; return object; }; /** - * Converts this ListTablesResponse to JSON. + * Converts this GenerateConsistencyTokenResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListTablesResponse + * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse * @instance * @returns {Object.} JSON object */ - ListTablesResponse.prototype.toJSON = function toJSON() { + GenerateConsistencyTokenResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListTablesResponse; + return GenerateConsistencyTokenResponse; })(); - v2.GetTableRequest = (function() { + v2.CheckConsistencyRequest = (function() { /** - * Properties of a GetTableRequest. + * Properties of a CheckConsistencyRequest. * @memberof google.bigtable.admin.v2 - * @interface IGetTableRequest - * @property {string|null} [name] GetTableRequest name - * @property {google.bigtable.admin.v2.Table.View|null} [view] GetTableRequest view + * @interface ICheckConsistencyRequest + * @property {string|null} [name] CheckConsistencyRequest name + * @property {string|null} [consistencyToken] CheckConsistencyRequest consistencyToken */ /** - * Constructs a new GetTableRequest. + * Constructs a new CheckConsistencyRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GetTableRequest. - * @implements IGetTableRequest + * @classdesc Represents a CheckConsistencyRequest. + * @implements ICheckConsistencyRequest * @constructor - * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set */ - function GetTableRequest(properties) { + function CheckConsistencyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11097,80 +10532,80 @@ } /** - * GetTableRequest name. + * CheckConsistencyRequest name. * @member {string} name - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @instance */ - GetTableRequest.prototype.name = ""; + CheckConsistencyRequest.prototype.name = ""; /** - * GetTableRequest view. - * @member {google.bigtable.admin.v2.Table.View} view - * @memberof google.bigtable.admin.v2.GetTableRequest + * CheckConsistencyRequest consistencyToken. + * @member {string} consistencyToken + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @instance */ - GetTableRequest.prototype.view = 0; + CheckConsistencyRequest.prototype.consistencyToken = ""; /** - * Creates a new GetTableRequest instance using the specified properties. + * Creates a new CheckConsistencyRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static - * @param {google.bigtable.admin.v2.IGetTableRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest instance + * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest instance */ - GetTableRequest.create = function create(properties) { - return new GetTableRequest(properties); + CheckConsistencyRequest.create = function create(properties) { + return new CheckConsistencyRequest(properties); }; /** - * Encodes the specified GetTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static - * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @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 */ - GetTableRequest.encode = function encode(message, writer) { + CheckConsistencyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consistencyToken); return writer; }; /** - * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetTableRequest.verify|verify} messages. + * 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.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static - * @param {google.bigtable.admin.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @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 */ - GetTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + CheckConsistencyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTableRequest message from the specified reader or buffer. + * Decodes a CheckConsistencyRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GetTableRequest + * @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.GetTableRequest} GetTableRequest + * @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 */ - GetTableRequest.decode = function decode(reader, length) { + CheckConsistencyRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -11178,7 +10613,7 @@ message.name = reader.string(); break; case 2: - message.view = reader.int32(); + message.consistencyToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -11189,144 +10624,116 @@ }; /** - * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @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 */ - GetTableRequest.decodeDelimited = function decodeDelimited(reader) { + CheckConsistencyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTableRequest message. + * Verifies a CheckConsistencyRequest message. * @function verify - * @memberof google.bigtable.admin.v2.GetTableRequest + * @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 */ - GetTableRequest.verify = function verify(message) { + CheckConsistencyRequest.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 4: - break; - } + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + if (!$util.isString(message.consistencyToken)) + return "consistencyToken: string expected"; return null; }; /** - * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GetTableRequest} GetTableRequest + * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest */ - GetTableRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GetTableRequest) + CheckConsistencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyRequest) return object; - var message = new $root.google.bigtable.admin.v2.GetTableRequest(); + var message = new $root.google.bigtable.admin.v2.CheckConsistencyRequest(); if (object.name != null) message.name = String(object.name); - switch (object.view) { - 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 "FULL": - case 4: - message.view = 4; - break; - } + if (object.consistencyToken != null) + message.consistencyToken = String(object.consistencyToken); return message; }; /** - * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * Creates a plain object from a CheckConsistencyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @static - * @param {google.bigtable.admin.v2.GetTableRequest} message GetTableRequest + * @param {google.bigtable.admin.v2.CheckConsistencyRequest} message CheckConsistencyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTableRequest.toObject = function toObject(message, options) { + CheckConsistencyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + object.consistencyToken = ""; } 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] : message.view; + if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) + object.consistencyToken = message.consistencyToken; return object; }; /** - * Converts this GetTableRequest to JSON. + * Converts this CheckConsistencyRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GetTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyRequest * @instance * @returns {Object.} JSON object */ - GetTableRequest.prototype.toJSON = function toJSON() { + CheckConsistencyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetTableRequest; + return CheckConsistencyRequest; })(); - v2.DeleteTableRequest = (function() { + v2.CheckConsistencyResponse = (function() { /** - * Properties of a DeleteTableRequest. + * Properties of a CheckConsistencyResponse. * @memberof google.bigtable.admin.v2 - * @interface IDeleteTableRequest - * @property {string|null} [name] DeleteTableRequest name + * @interface ICheckConsistencyResponse + * @property {boolean|null} [consistent] CheckConsistencyResponse consistent */ /** - * Constructs a new DeleteTableRequest. + * Constructs a new CheckConsistencyResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a DeleteTableRequest. - * @implements IDeleteTableRequest + * @classdesc Represents a CheckConsistencyResponse. + * @implements ICheckConsistencyResponse * @constructor - * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set */ - function DeleteTableRequest(properties) { + function CheckConsistencyResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11334,75 +10741,75 @@ } /** - * DeleteTableRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * CheckConsistencyResponse consistent. + * @member {boolean} consistent + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @instance */ - DeleteTableRequest.prototype.name = ""; + CheckConsistencyResponse.prototype.consistent = false; /** - * Creates a new DeleteTableRequest instance using the specified properties. + * Creates a new CheckConsistencyResponse instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static - * @param {google.bigtable.admin.v2.IDeleteTableRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest instance + * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse instance */ - DeleteTableRequest.create = function create(properties) { - return new DeleteTableRequest(properties); + CheckConsistencyResponse.create = function create(properties) { + return new CheckConsistencyResponse(properties); }; /** - * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static - * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @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 */ - DeleteTableRequest.encode = function encode(message, writer) { + CheckConsistencyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.consistent != null && message.hasOwnProperty("consistent")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.consistent); return writer; }; /** - * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteTableRequest.verify|verify} messages. + * 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.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static - * @param {google.bigtable.admin.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @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 */ - DeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + CheckConsistencyResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteTableRequest message from the specified reader or buffer. + * Decodes a CheckConsistencyResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @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.DeleteTableRequest} DeleteTableRequest + * @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 */ - DeleteTableRequest.decode = function decode(reader, length) { + CheckConsistencyResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.consistent = reader.bool(); break; default: reader.skipType(tag & 7); @@ -11413,109 +10820,111 @@ }; /** - * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @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 */ - DeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + CheckConsistencyResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteTableRequest message. + * Verifies a CheckConsistencyResponse message. * @function verify - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @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 */ - DeleteTableRequest.verify = function verify(message) { + CheckConsistencyResponse.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.consistent != null && message.hasOwnProperty("consistent")) + if (typeof message.consistent !== "boolean") + return "consistent: boolean expected"; return null; }; /** - * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.DeleteTableRequest} DeleteTableRequest + * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse */ - DeleteTableRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.DeleteTableRequest) + CheckConsistencyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyResponse) return object; - var message = new $root.google.bigtable.admin.v2.DeleteTableRequest(); - if (object.name != null) - message.name = String(object.name); + 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 DeleteTableRequest message. Also converts values to other types if specified. + * Creates a plain object from a CheckConsistencyResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @static - * @param {google.bigtable.admin.v2.DeleteTableRequest} message DeleteTableRequest + * @param {google.bigtable.admin.v2.CheckConsistencyResponse} message CheckConsistencyResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteTableRequest.toObject = function toObject(message, options) { + CheckConsistencyResponse.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; + object.consistent = false; + if (message.consistent != null && message.hasOwnProperty("consistent")) + object.consistent = message.consistent; return object; }; /** - * Converts this DeleteTableRequest to JSON. + * Converts this CheckConsistencyResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.DeleteTableRequest + * @memberof google.bigtable.admin.v2.CheckConsistencyResponse * @instance * @returns {Object.} JSON object */ - DeleteTableRequest.prototype.toJSON = function toJSON() { + CheckConsistencyResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteTableRequest; + return CheckConsistencyResponse; })(); - v2.ModifyColumnFamiliesRequest = (function() { + v2.SnapshotTableRequest = (function() { /** - * Properties of a ModifyColumnFamiliesRequest. + * Properties of a SnapshotTableRequest. * @memberof google.bigtable.admin.v2 - * @interface IModifyColumnFamiliesRequest - * @property {string|null} [name] ModifyColumnFamiliesRequest name - * @property {Array.|null} [modifications] ModifyColumnFamiliesRequest modifications + * @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 ModifyColumnFamiliesRequest. + * Constructs a new SnapshotTableRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ModifyColumnFamiliesRequest. - * @implements IModifyColumnFamiliesRequest + * @classdesc Represents a SnapshotTableRequest. + * @implements ISnapshotTableRequest * @constructor - * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set */ - function ModifyColumnFamiliesRequest(properties) { - this.modifications = []; + function SnapshotTableRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11523,81 +10932,110 @@ } /** - * ModifyColumnFamiliesRequest name. + * SnapshotTableRequest name. * @member {string} name - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @instance */ - ModifyColumnFamiliesRequest.prototype.name = ""; + SnapshotTableRequest.prototype.name = ""; /** - * ModifyColumnFamiliesRequest modifications. - * @member {Array.} modifications - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * SnapshotTableRequest cluster. + * @member {string} cluster + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @instance */ - ModifyColumnFamiliesRequest.prototype.modifications = $util.emptyArray; + SnapshotTableRequest.prototype.cluster = ""; /** - * Creates a new ModifyColumnFamiliesRequest instance using the specified properties. + * 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.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @static - * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest instance + * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest instance */ - ModifyColumnFamiliesRequest.create = function create(properties) { - return new ModifyColumnFamiliesRequest(properties); + SnapshotTableRequest.create = function create(properties) { + return new SnapshotTableRequest(properties); }; /** - * Encodes the specified ModifyColumnFamiliesRequest message. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @static - * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @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 */ - ModifyColumnFamiliesRequest.encode = function encode(message, writer) { + SnapshotTableRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.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.cluster != null && message.hasOwnProperty("cluster")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cluster); + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotId); + if (message.ttl != null && message.hasOwnProperty("ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); return writer; }; /** - * Encodes the specified ModifyColumnFamiliesRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ModifyColumnFamiliesRequest.verify|verify} messages. + * 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.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @static - * @param {google.bigtable.admin.v2.IModifyColumnFamiliesRequest} message ModifyColumnFamiliesRequest message or plain object to encode + * @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 */ - ModifyColumnFamiliesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SnapshotTableRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer. + * Decodes a SnapshotTableRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @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.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @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 */ - ModifyColumnFamiliesRequest.decode = function decode(reader, length) { + SnapshotTableRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -11605,9 +11043,16 @@ 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())); + 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); @@ -11618,429 +11063,145 @@ }; /** - * Decodes a ModifyColumnFamiliesRequest message from the specified reader or buffer, length delimited. + * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @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 */ - ModifyColumnFamiliesRequest.decodeDelimited = function decodeDelimited(reader) { + SnapshotTableRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ModifyColumnFamiliesRequest message. + * Verifies a SnapshotTableRequest message. * @function verify - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @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 */ - ModifyColumnFamiliesRequest.verify = function verify(message) { + 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.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.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 ModifyColumnFamiliesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SnapshotTableRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest + * @memberof google.bigtable.admin.v2.SnapshotTableRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ModifyColumnFamiliesRequest} ModifyColumnFamiliesRequest + * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest */ - ModifyColumnFamiliesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + SnapshotTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableRequest) return object; - var message = new $root.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + var message = new $root.google.bigtable.admin.v2.SnapshotTableRequest(); 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]); - } - } - 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 = ""; - 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); - } - 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); - }; - - 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 - */ - - /** - * 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]]; + 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; + }; - /** - * 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} drop - * @memberof google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification - * @instance - */ - Modification.prototype.drop = false; - - // 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 && message.hasOwnProperty("id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.create != null && message.hasOwnProperty("create")) - $root.google.bigtable.admin.v2.ColumnFamily.encode(message.create, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.update != null && message.hasOwnProperty("update")) - $root.google.bigtable.admin.v2.ColumnFamily.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.drop != null && message.hasOwnProperty("drop")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.drop); - 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) { - 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(); - 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; - 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"; - } - 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); - 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 = ""; - 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"; - } - 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); - }; - - return Modification; - })(); + /** + * 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; + }; - return ModifyColumnFamiliesRequest; + /** + * 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); + }; + + return SnapshotTableRequest; })(); - v2.GenerateConsistencyTokenRequest = (function() { + v2.GetSnapshotRequest = (function() { /** - * Properties of a GenerateConsistencyTokenRequest. + * Properties of a GetSnapshotRequest. * @memberof google.bigtable.admin.v2 - * @interface IGenerateConsistencyTokenRequest - * @property {string|null} [name] GenerateConsistencyTokenRequest name + * @interface IGetSnapshotRequest + * @property {string|null} [name] GetSnapshotRequest name */ /** - * Constructs a new GenerateConsistencyTokenRequest. + * Constructs a new GetSnapshotRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GenerateConsistencyTokenRequest. - * @implements IGenerateConsistencyTokenRequest + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest * @constructor - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set */ - function GenerateConsistencyTokenRequest(properties) { + function GetSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12048,35 +11209,35 @@ } /** - * GenerateConsistencyTokenRequest name. + * GetSnapshotRequest name. * @member {string} name - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @instance */ - GenerateConsistencyTokenRequest.prototype.name = ""; + GetSnapshotRequest.prototype.name = ""; /** - * Creates a new GenerateConsistencyTokenRequest instance using the specified properties. + * Creates a new GetSnapshotRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest instance + * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest instance */ - GenerateConsistencyTokenRequest.create = function create(properties) { - return new GenerateConsistencyTokenRequest(properties); + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); }; /** - * Encodes the specified GenerateConsistencyTokenRequest message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @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 */ - GenerateConsistencyTokenRequest.encode = function encode(message, writer) { + GetSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) @@ -12085,33 +11246,33 @@ }; /** - * Encodes the specified GenerateConsistencyTokenRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenRequest.verify|verify} messages. + * 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.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest message or plain object to encode + * @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 */ - GenerateConsistencyTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer. + * Decodes a GetSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @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.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @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 */ - GenerateConsistencyTokenRequest.decode = function decode(reader, length) { + GetSnapshotRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -12127,30 +11288,30 @@ }; /** - * Decodes a GenerateConsistencyTokenRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @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 */ - GenerateConsistencyTokenRequest.decodeDelimited = function decodeDelimited(reader) { + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateConsistencyTokenRequest message. + * Verifies a GetSnapshotRequest message. * @function verify - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @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 */ - GenerateConsistencyTokenRequest.verify = function verify(message) { + GetSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -12160,32 +11321,32 @@ }; /** - * Creates a GenerateConsistencyTokenRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} GenerateConsistencyTokenRequest + * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest */ - GenerateConsistencyTokenRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GetSnapshotRequest) return object; - var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + 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 GenerateConsistencyTokenRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @static - * @param {google.bigtable.admin.v2.GenerateConsistencyTokenRequest} message GenerateConsistencyTokenRequest + * @param {google.bigtable.admin.v2.GetSnapshotRequest} message GetSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateConsistencyTokenRequest.toObject = function toObject(message, options) { + GetSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -12197,37 +11358,39 @@ }; /** - * Converts this GenerateConsistencyTokenRequest to JSON. + * Converts this GetSnapshotRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenRequest + * @memberof google.bigtable.admin.v2.GetSnapshotRequest * @instance * @returns {Object.} JSON object */ - GenerateConsistencyTokenRequest.prototype.toJSON = function toJSON() { + GetSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GenerateConsistencyTokenRequest; + return GetSnapshotRequest; })(); - v2.GenerateConsistencyTokenResponse = (function() { + v2.ListSnapshotsRequest = (function() { /** - * Properties of a GenerateConsistencyTokenResponse. + * Properties of a ListSnapshotsRequest. * @memberof google.bigtable.admin.v2 - * @interface IGenerateConsistencyTokenResponse - * @property {string|null} [consistencyToken] GenerateConsistencyTokenResponse consistencyToken + * @interface IListSnapshotsRequest + * @property {string|null} [parent] ListSnapshotsRequest parent + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken */ /** - * Constructs a new GenerateConsistencyTokenResponse. + * Constructs a new ListSnapshotsRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GenerateConsistencyTokenResponse. - * @implements IGenerateConsistencyTokenResponse + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest * @constructor - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set */ - function GenerateConsistencyTokenResponse(properties) { + function ListSnapshotsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12235,75 +11398,101 @@ } /** - * GenerateConsistencyTokenResponse consistencyToken. - * @member {string} consistencyToken - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * ListSnapshotsRequest parent. + * @member {string} parent + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @instance */ - GenerateConsistencyTokenResponse.prototype.consistencyToken = ""; + ListSnapshotsRequest.prototype.parent = ""; /** - * Creates a new GenerateConsistencyTokenResponse instance using the specified properties. + * 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.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse instance + * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest instance */ - GenerateConsistencyTokenResponse.create = function create(properties) { - return new GenerateConsistencyTokenResponse(properties); + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); }; /** - * Encodes the specified GenerateConsistencyTokenResponse message. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @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 */ - GenerateConsistencyTokenResponse.encode = function encode(message, writer) { + ListSnapshotsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consistencyToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GenerateConsistencyTokenResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse.verify|verify} messages. + * 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.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static - * @param {google.bigtable.admin.v2.IGenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse message or plain object to encode + * @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 */ - GenerateConsistencyTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @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.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @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 */ - GenerateConsistencyTokenResponse.decode = function decode(reader, length) { + ListSnapshotsRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.consistencyToken = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -12314,108 +11503,126 @@ }; /** - * Decodes a GenerateConsistencyTokenResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @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 */ - GenerateConsistencyTokenResponse.decodeDelimited = function decodeDelimited(reader) { + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateConsistencyTokenResponse message. + * Verifies a ListSnapshotsRequest message. * @function verify - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @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 */ - GenerateConsistencyTokenResponse.verify = function verify(message) { + ListSnapshotsRequest.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"; + 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 GenerateConsistencyTokenResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} GenerateConsistencyTokenResponse + * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest */ - GenerateConsistencyTokenResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsRequest) return object; - var message = new $root.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); - if (object.consistencyToken != null) - message.consistencyToken = String(object.consistencyToken); + 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 GenerateConsistencyTokenResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @static - * @param {google.bigtable.admin.v2.GenerateConsistencyTokenResponse} message GenerateConsistencyTokenResponse + * @param {google.bigtable.admin.v2.ListSnapshotsRequest} message ListSnapshotsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateConsistencyTokenResponse.toObject = function toObject(message, options) { + ListSnapshotsRequest.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; + 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 GenerateConsistencyTokenResponse to JSON. + * Converts this ListSnapshotsRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GenerateConsistencyTokenResponse + * @memberof google.bigtable.admin.v2.ListSnapshotsRequest * @instance * @returns {Object.} JSON object */ - GenerateConsistencyTokenResponse.prototype.toJSON = function toJSON() { + ListSnapshotsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GenerateConsistencyTokenResponse; + return ListSnapshotsRequest; })(); - v2.CheckConsistencyRequest = (function() { + v2.ListSnapshotsResponse = (function() { /** - * Properties of a CheckConsistencyRequest. + * Properties of a ListSnapshotsResponse. * @memberof google.bigtable.admin.v2 - * @interface ICheckConsistencyRequest - * @property {string|null} [name] CheckConsistencyRequest name - * @property {string|null} [consistencyToken] CheckConsistencyRequest consistencyToken + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken */ /** - * Constructs a new CheckConsistencyRequest. + * Constructs a new ListSnapshotsResponse. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CheckConsistencyRequest. - * @implements ICheckConsistencyRequest + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse * @constructor - * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set */ - function CheckConsistencyRequest(properties) { + function ListSnapshotsResponse(properties) { + this.snapshots = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12423,88 +11630,91 @@ } /** - * CheckConsistencyRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @instance */ - CheckConsistencyRequest.prototype.name = ""; + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; /** - * CheckConsistencyRequest consistencyToken. - * @member {string} consistencyToken - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @instance */ - CheckConsistencyRequest.prototype.consistencyToken = ""; + ListSnapshotsResponse.prototype.nextPageToken = ""; /** - * Creates a new CheckConsistencyRequest instance using the specified properties. + * Creates a new ListSnapshotsResponse instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest instance + * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse instance */ - CheckConsistencyRequest.create = function create(properties) { - return new CheckConsistencyRequest(properties); + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); }; /** - * Encodes the specified CheckConsistencyRequest message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @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 */ - CheckConsistencyRequest.encode = function encode(message, writer) { + ListSnapshotsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.consistencyToken); + 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 && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CheckConsistencyRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyRequest.verify|verify} messages. + * 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.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyRequest} message CheckConsistencyRequest message or plain object to encode + * @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 */ - CheckConsistencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CheckConsistencyRequest message from the specified reader or buffer. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @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.CheckConsistencyRequest} CheckConsistencyRequest + * @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 */ - CheckConsistencyRequest.decode = function decode(reader, length) { + ListSnapshotsResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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.consistencyToken = reader.string(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -12515,116 +11725,133 @@ }; /** - * Decodes a CheckConsistencyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @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 */ - CheckConsistencyRequest.decodeDelimited = function decodeDelimited(reader) { + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CheckConsistencyRequest message. + * Verifies a ListSnapshotsResponse message. * @function verify - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @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 */ - CheckConsistencyRequest.verify = function verify(message) { + ListSnapshotsResponse.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.consistencyToken != null && message.hasOwnProperty("consistencyToken")) - if (!$util.isString(message.consistencyToken)) - return "consistencyToken: string 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 CheckConsistencyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CheckConsistencyRequest} CheckConsistencyRequest + * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse */ - CheckConsistencyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyRequest) + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsResponse) 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); + 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 CheckConsistencyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @static - * @param {google.bigtable.admin.v2.CheckConsistencyRequest} message CheckConsistencyRequest + * @param {google.bigtable.admin.v2.ListSnapshotsResponse} message ListSnapshotsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CheckConsistencyRequest.toObject = function toObject(message, options) { + ListSnapshotsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.consistencyToken = ""; + 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.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.consistencyToken != null && message.hasOwnProperty("consistencyToken")) - object.consistencyToken = message.consistencyToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CheckConsistencyRequest to JSON. + * Converts this ListSnapshotsResponse to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CheckConsistencyRequest + * @memberof google.bigtable.admin.v2.ListSnapshotsResponse * @instance * @returns {Object.} JSON object */ - CheckConsistencyRequest.prototype.toJSON = function toJSON() { + ListSnapshotsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CheckConsistencyRequest; + return ListSnapshotsResponse; })(); - v2.CheckConsistencyResponse = (function() { + v2.DeleteSnapshotRequest = (function() { /** - * Properties of a CheckConsistencyResponse. + * Properties of a DeleteSnapshotRequest. * @memberof google.bigtable.admin.v2 - * @interface ICheckConsistencyResponse - * @property {boolean|null} [consistent] CheckConsistencyResponse consistent + * @interface IDeleteSnapshotRequest + * @property {string|null} [name] DeleteSnapshotRequest name */ /** - * Constructs a new CheckConsistencyResponse. + * Constructs a new DeleteSnapshotRequest. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CheckConsistencyResponse. - * @implements ICheckConsistencyResponse + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest * @constructor - * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set */ - function CheckConsistencyResponse(properties) { + function DeleteSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12632,75 +11859,75 @@ } /** - * CheckConsistencyResponse consistent. - * @member {boolean} consistent - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * DeleteSnapshotRequest name. + * @member {string} name + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @instance */ - CheckConsistencyResponse.prototype.consistent = false; + DeleteSnapshotRequest.prototype.name = ""; /** - * Creates a new CheckConsistencyResponse instance using the specified properties. + * Creates a new DeleteSnapshotRequest instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse instance + * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest instance */ - CheckConsistencyResponse.create = function create(properties) { - return new CheckConsistencyResponse(properties); + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); }; /** - * Encodes the specified CheckConsistencyResponse message. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @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 */ - CheckConsistencyResponse.encode = function encode(message, writer) { + DeleteSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.consistent != null && message.hasOwnProperty("consistent")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.consistent); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CheckConsistencyResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CheckConsistencyResponse.verify|verify} messages. + * 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.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static - * @param {google.bigtable.admin.v2.ICheckConsistencyResponse} message CheckConsistencyResponse message or plain object to encode + * @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 */ - CheckConsistencyResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CheckConsistencyResponse message from the specified reader or buffer. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @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.CheckConsistencyResponse} CheckConsistencyResponse + * @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 */ - CheckConsistencyResponse.decode = function decode(reader, length) { + DeleteSnapshotRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.consistent = reader.bool(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -12711,111 +11938,109 @@ }; /** - * Decodes a CheckConsistencyResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @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 */ - CheckConsistencyResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CheckConsistencyResponse message. + * Verifies a DeleteSnapshotRequest message. * @function verify - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @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 */ - CheckConsistencyResponse.verify = function verify(message) { + DeleteSnapshotRequest.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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CheckConsistencyResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CheckConsistencyResponse} CheckConsistencyResponse + * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest */ - CheckConsistencyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CheckConsistencyResponse) + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.DeleteSnapshotRequest) return object; - var message = new $root.google.bigtable.admin.v2.CheckConsistencyResponse(); - if (object.consistent != null) - message.consistent = Boolean(object.consistent); + 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 CheckConsistencyResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @static - * @param {google.bigtable.admin.v2.CheckConsistencyResponse} message CheckConsistencyResponse + * @param {google.bigtable.admin.v2.DeleteSnapshotRequest} message DeleteSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CheckConsistencyResponse.toObject = function toObject(message, options) { + DeleteSnapshotRequest.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; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CheckConsistencyResponse to JSON. + * Converts this DeleteSnapshotRequest to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CheckConsistencyResponse + * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest * @instance * @returns {Object.} JSON object */ - CheckConsistencyResponse.prototype.toJSON = function toJSON() { + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CheckConsistencyResponse; + return DeleteSnapshotRequest; })(); - v2.SnapshotTableRequest = (function() { + v2.SnapshotTableMetadata = (function() { /** - * Properties of a SnapshotTableRequest. + * Properties of a SnapshotTableMetadata. * @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 + * @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 SnapshotTableRequest. + * Constructs a new SnapshotTableMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a SnapshotTableRequest. - * @implements ISnapshotTableRequest + * @classdesc Represents a SnapshotTableMetadata. + * @implements ISnapshotTableMetadata * @constructor - * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set */ - function SnapshotTableRequest(properties) { + function SnapshotTableMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12823,127 +12048,101 @@ } /** - * 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 + * SnapshotTableMetadata originalRequest. + * @member {google.bigtable.admin.v2.ISnapshotTableRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @instance */ - SnapshotTableRequest.prototype.snapshotId = ""; + SnapshotTableMetadata.prototype.originalRequest = null; /** - * SnapshotTableRequest ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * SnapshotTableMetadata requestTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @instance */ - SnapshotTableRequest.prototype.ttl = null; + SnapshotTableMetadata.prototype.requestTime = null; /** - * SnapshotTableRequest description. - * @member {string} description - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * SnapshotTableMetadata finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @instance */ - SnapshotTableRequest.prototype.description = ""; + SnapshotTableMetadata.prototype.finishTime = null; /** - * Creates a new SnapshotTableRequest instance using the specified properties. + * Creates a new SnapshotTableMetadata instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static - * @param {google.bigtable.admin.v2.ISnapshotTableRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest instance + * @param {google.bigtable.admin.v2.ISnapshotTableMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata instance */ - SnapshotTableRequest.create = function create(properties) { - return new SnapshotTableRequest(properties); + SnapshotTableMetadata.create = function create(properties) { + return new SnapshotTableMetadata(properties); }; /** - * Encodes the specified SnapshotTableRequest message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * Encodes the specified SnapshotTableMetadata message. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static - * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @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 */ - SnapshotTableRequest.encode = function encode(message, writer) { + SnapshotTableMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.cluster != null && message.hasOwnProperty("cluster")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cluster); - if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotId); - if (message.ttl != null && message.hasOwnProperty("ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.SnapshotTableRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified SnapshotTableRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.SnapshotTableRequest.verify|verify} messages. + * 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.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static - * @param {google.bigtable.admin.v2.ISnapshotTableRequest} message SnapshotTableRequest message or plain object to encode + * @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 */ - SnapshotTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + SnapshotTableMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SnapshotTableRequest message from the specified reader or buffer. + * Decodes a SnapshotTableMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @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.SnapshotTableRequest} SnapshotTableRequest + * @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 */ - SnapshotTableRequest.decode = function decode(reader, length) { + SnapshotTableMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.originalRequest = $root.google.bigtable.admin.v2.SnapshotTableRequest.decode(reader, reader.uint32()); break; case 2: - message.cluster = reader.string(); + message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); 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(); + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12954,145 +12153,141 @@ }; /** - * Decodes a SnapshotTableRequest message from the specified reader or buffer, length delimited. + * Decodes a SnapshotTableMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @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 */ - SnapshotTableRequest.decodeDelimited = function decodeDelimited(reader) { + SnapshotTableMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SnapshotTableRequest message. + * Verifies a SnapshotTableMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @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 */ - SnapshotTableRequest.verify = function verify(message) { + SnapshotTableMetadata.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 (message.originalRequest != null && message.hasOwnProperty("originalRequest")) { + var error = $root.google.bigtable.admin.v2.SnapshotTableRequest.verify(message.originalRequest); if (error) - return "ttl." + 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.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. + * Creates a SnapshotTableMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.SnapshotTableRequest} SnapshotTableRequest + * @returns {google.bigtable.admin.v2.SnapshotTableMetadata} SnapshotTableMetadata */ - SnapshotTableRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableRequest) + SnapshotTableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.SnapshotTableMetadata) 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); + 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); } - 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. + * Creates a plain object from a SnapshotTableMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @static - * @param {google.bigtable.admin.v2.SnapshotTableRequest} message SnapshotTableRequest + * @param {google.bigtable.admin.v2.SnapshotTableMetadata} message SnapshotTableMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SnapshotTableRequest.toObject = function toObject(message, options) { + SnapshotTableMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.cluster = ""; - object.snapshotId = ""; - object.ttl = null; - object.description = ""; + object.originalRequest = null; + object.requestTime = null; + object.finishTime = null; } - 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; + 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 SnapshotTableRequest to JSON. + * Converts this SnapshotTableMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.SnapshotTableRequest + * @memberof google.bigtable.admin.v2.SnapshotTableMetadata * @instance * @returns {Object.} JSON object */ - SnapshotTableRequest.prototype.toJSON = function toJSON() { + SnapshotTableMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SnapshotTableRequest; + return SnapshotTableMetadata; })(); - v2.GetSnapshotRequest = (function() { + v2.CreateTableFromSnapshotMetadata = (function() { /** - * Properties of a GetSnapshotRequest. + * Properties of a CreateTableFromSnapshotMetadata. * @memberof google.bigtable.admin.v2 - * @interface IGetSnapshotRequest - * @property {string|null} [name] GetSnapshotRequest name + * @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 GetSnapshotRequest. + * Constructs a new CreateTableFromSnapshotMetadata. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a GetSnapshotRequest. - * @implements IGetSnapshotRequest + * @classdesc Represents a CreateTableFromSnapshotMetadata. + * @implements ICreateTableFromSnapshotMetadata * @constructor - * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set */ - function GetSnapshotRequest(properties) { + function CreateTableFromSnapshotMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13100,75 +12295,101 @@ } /** - * GetSnapshotRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * CreateTableFromSnapshotMetadata originalRequest. + * @member {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null|undefined} originalRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @instance */ - GetSnapshotRequest.prototype.name = ""; + CreateTableFromSnapshotMetadata.prototype.originalRequest = null; /** - * Creates a new GetSnapshotRequest instance using the specified properties. + * 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.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static - * @param {google.bigtable.admin.v2.IGetSnapshotRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest instance + * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata instance */ - GetSnapshotRequest.create = function create(properties) { - return new GetSnapshotRequest(properties); + CreateTableFromSnapshotMetadata.create = function create(properties) { + return new CreateTableFromSnapshotMetadata(properties); }; /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static - * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @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 */ - GetSnapshotRequest.encode = function encode(message, writer) { + CreateTableFromSnapshotMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) + $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestTime != null && message.hasOwnProperty("requestTime")) + $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.GetSnapshotRequest.verify|verify} messages. + * 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.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static - * @param {google.bigtable.admin.v2.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @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 */ - GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateTableFromSnapshotMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @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.GetSnapshotRequest} GetSnapshotRequest + * @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 */ - GetSnapshotRequest.decode = function decode(reader, length) { + CreateTableFromSnapshotMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -13179,109 +12400,144 @@ }; /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @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 */ - GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + CreateTableFromSnapshotMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSnapshotRequest message. + * Verifies a CreateTableFromSnapshotMetadata message. * @function verify - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @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 */ - GetSnapshotRequest.verify = function verify(message) { + CreateTableFromSnapshotMetadata.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.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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.GetSnapshotRequest} GetSnapshotRequest + * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata */ - GetSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.GetSnapshotRequest) + CreateTableFromSnapshotMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) return object; - var message = new $root.google.bigtable.admin.v2.GetSnapshotRequest(); - if (object.name != null) - message.name = String(object.name); + 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 GetSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @static - * @param {google.bigtable.admin.v2.GetSnapshotRequest} message GetSnapshotRequest + * @param {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSnapshotRequest.toObject = function toObject(message, options) { + CreateTableFromSnapshotMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.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 GetSnapshotRequest to JSON. + * Converts this CreateTableFromSnapshotMetadata to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.GetSnapshotRequest + * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata * @instance * @returns {Object.} JSON object */ - GetSnapshotRequest.prototype.toJSON = function toJSON() { + CreateTableFromSnapshotMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSnapshotRequest; + return CreateTableFromSnapshotMetadata; })(); - v2.ListSnapshotsRequest = (function() { + v2.Table = (function() { /** - * Properties of a ListSnapshotsRequest. + * Properties of a Table. * @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 + * @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 */ /** - * Constructs a new ListSnapshotsRequest. + * Constructs a new Table. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListSnapshotsRequest. - * @implements IListSnapshotsRequest + * @classdesc Represents a Table. + * @implements ITable * @constructor - * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set */ - function ListSnapshotsRequest(properties) { + 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) @@ -13289,101 +12545,130 @@ } /** - * ListSnapshotsRequest parent. - * @member {string} parent - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * Table name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Table * @instance */ - ListSnapshotsRequest.prototype.parent = ""; + Table.prototype.name = ""; /** - * ListSnapshotsRequest pageSize. - * @member {number} pageSize - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * Table clusterStates. + * @member {Object.} clusterStates + * @memberof google.bigtable.admin.v2.Table * @instance */ - ListSnapshotsRequest.prototype.pageSize = 0; + Table.prototype.clusterStates = $util.emptyObject; /** - * ListSnapshotsRequest pageToken. - * @member {string} pageToken - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * Table columnFamilies. + * @member {Object.} columnFamilies + * @memberof google.bigtable.admin.v2.Table * @instance */ - ListSnapshotsRequest.prototype.pageToken = ""; + Table.prototype.columnFamilies = $util.emptyObject; /** - * Creates a new ListSnapshotsRequest instance using the specified properties. + * Table granularity. + * @member {google.bigtable.admin.v2.Table.TimestampGranularity} granularity + * @memberof google.bigtable.admin.v2.Table + * @instance + */ + Table.prototype.granularity = 0; + + /** + * Creates a new Table instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @memberof google.bigtable.admin.v2.Table * @static - * @param {google.bigtable.admin.v2.IListSnapshotsRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest instance + * @param {google.bigtable.admin.v2.ITable=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Table} Table instance */ - ListSnapshotsRequest.create = function create(properties) { - return new ListSnapshotsRequest(properties); + Table.create = function create(properties) { + return new Table(properties); }; /** - * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * Encodes the specified Table message. Does not implicitly {@link google.bigtable.admin.v2.Table.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @memberof google.bigtable.admin.v2.Table * @static - * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @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 */ - ListSnapshotsRequest.encode = function encode(message, writer) { + Table.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clusterStates != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("granularity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.granularity); return writer; }; /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsRequest.verify|verify} messages. + * 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.ListSnapshotsRequest + * @memberof google.bigtable.admin.v2.Table * @static - * @param {google.bigtable.admin.v2.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @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 */ - ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Table.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * Decodes a Table message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @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.ListSnapshotsRequest} ListSnapshotsRequest + * @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 */ - ListSnapshotsRequest.decode = function decode(reader, length) { + Table.decode = function decode(reader, length) { 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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.Table(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.pageSize = reader.int32(); + reader.skip().pos++; + if (message.clusterStates === $util.emptyObject) + message.clusterStates = {}; + key = reader.string(); + reader.pos++; + message.clusterStates[key] = $root.google.bigtable.admin.v2.Table.ClusterState.decode(reader, reader.uint32()); break; case 3: - message.pageToken = reader.string(); + reader.skip().pos++; + if (message.columnFamilies === $util.emptyObject) + message.columnFamilies = {}; + key = reader.string(); + reader.pos++; + message.columnFamilies[key] = $root.google.bigtable.admin.v2.ColumnFamily.decode(reader, reader.uint32()); + break; + case 4: + message.granularity = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13394,126 +12679,453 @@ }; /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * Decodes a Table message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @memberof google.bigtable.admin.v2.Table * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListSnapshotsRequest} ListSnapshotsRequest + * @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 */ - ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + Table.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSnapshotsRequest message. + * Verifies a Table message. * @function verify - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest + * @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 */ - ListSnapshotsRequest.verify = function verify(message) { + Table.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.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; + } 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) + /** + * 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) { + case "TIMESTAMP_GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "MILLIS": + case 1: + message.granularity = 1; + break; + } + 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; + } + 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] : message.granularity; + 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); + }; + + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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 && message.hasOwnProperty("replicationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.replicationState); + 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) { + 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(); + switch (tag >>> 3) { + case 1: + message.replicationState = reader.int32(); + 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: + break; + } + 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) { + 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; + } + 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.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] : message.replicationState; 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; - }; + }; + + /** + * 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); + }; + + /** + * ReplicationState enum. + * @name google.bigtable.admin.v2.Table.ClusterState.ReplicationState + * @enum {string} + * @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 + */ + 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; + return values; + })(); + + return ClusterState; + })(); /** - * 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 + * TimestampGranularity enum. + * @name google.bigtable.admin.v2.Table.TimestampGranularity + * @enum {string} + * @property {number} TIMESTAMP_GRANULARITY_UNSPECIFIED=0 TIMESTAMP_GRANULARITY_UNSPECIFIED value + * @property {number} MILLIS=1 MILLIS value */ - 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; - }; + Table.TimestampGranularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIMESTAMP_GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "MILLIS"] = 1; + return values; + })(); /** - * Converts this ListSnapshotsRequest to JSON. - * @function toJSON - * @memberof google.bigtable.admin.v2.ListSnapshotsRequest - * @instance - * @returns {Object.} JSON object + * View enum. + * @name google.bigtable.admin.v2.Table.View + * @enum {string} + * @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} FULL=4 FULL value */ - ListSnapshotsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + 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[4] = "FULL"] = 4; + return values; + })(); - return ListSnapshotsRequest; + return Table; })(); - v2.ListSnapshotsResponse = (function() { + v2.ColumnFamily = (function() { /** - * Properties of a ListSnapshotsResponse. + * Properties of a ColumnFamily. * @memberof google.bigtable.admin.v2 - * @interface IListSnapshotsResponse - * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots - * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + * @interface IColumnFamily + * @property {google.bigtable.admin.v2.IGcRule|null} [gcRule] ColumnFamily gcRule */ /** - * Constructs a new ListSnapshotsResponse. + * Constructs a new ColumnFamily. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a ListSnapshotsResponse. - * @implements IListSnapshotsResponse + * @classdesc Represents a ColumnFamily. + * @implements IColumnFamily * @constructor - * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set */ - function ListSnapshotsResponse(properties) { - this.snapshots = []; + function ColumnFamily(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13521,91 +13133,75 @@ } /** - * 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 + * ColumnFamily gcRule. + * @member {google.bigtable.admin.v2.IGcRule|null|undefined} gcRule + * @memberof google.bigtable.admin.v2.ColumnFamily * @instance */ - ListSnapshotsResponse.prototype.nextPageToken = ""; + ColumnFamily.prototype.gcRule = null; /** - * Creates a new ListSnapshotsResponse instance using the specified properties. + * Creates a new ColumnFamily instance using the specified properties. * @function create - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static - * @param {google.bigtable.admin.v2.IListSnapshotsResponse=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse instance + * @param {google.bigtable.admin.v2.IColumnFamily=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily instance */ - ListSnapshotsResponse.create = function create(properties) { - return new ListSnapshotsResponse(properties); + ColumnFamily.create = function create(properties) { + return new ColumnFamily(properties); }; /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * Encodes the specified ColumnFamily message. Does not implicitly {@link google.bigtable.admin.v2.ColumnFamily.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static - * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @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 */ - ListSnapshotsResponse.encode = function encode(message, writer) { + ColumnFamily.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 && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.gcRule != null && message.hasOwnProperty("gcRule")) + $root.google.bigtable.admin.v2.GcRule.encode(message.gcRule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.ListSnapshotsResponse.verify|verify} messages. + * 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.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static - * @param {google.bigtable.admin.v2.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @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 */ - ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * Decodes a ColumnFamily message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @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.ListSnapshotsResponse} ListSnapshotsResponse + * @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 */ - ListSnapshotsResponse.decode = function decode(reader, length) { + ColumnFamily.decode = function decode(reader, length) { 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(); + 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(); 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(); + message.gcRule = $root.google.bigtable.admin.v2.GcRule.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13616,133 +13212,115 @@ }; /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * Decodes a ColumnFamily message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @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 */ - ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + ColumnFamily.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSnapshotsResponse message. + * Verifies a ColumnFamily message. * @function verify - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @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 */ - ListSnapshotsResponse.verify = function verify(message) { + ColumnFamily.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.gcRule != null && message.hasOwnProperty("gcRule")) { + var error = $root.google.bigtable.admin.v2.GcRule.verify(message.gcRule); + if (error) + return "gcRule." + 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. + * Creates a ColumnFamily message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.ListSnapshotsResponse} ListSnapshotsResponse + * @returns {google.bigtable.admin.v2.ColumnFamily} ColumnFamily */ - ListSnapshotsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.ListSnapshotsResponse) + ColumnFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.ColumnFamily) 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]); - } + 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.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. + * Creates a plain object from a ColumnFamily message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @static - * @param {google.bigtable.admin.v2.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {google.bigtable.admin.v2.ColumnFamily} message ColumnFamily * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSnapshotsResponse.toObject = function toObject(message, options) { + ColumnFamily.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; + object.gcRule = null; + if (message.gcRule != null && message.hasOwnProperty("gcRule")) + object.gcRule = $root.google.bigtable.admin.v2.GcRule.toObject(message.gcRule, options); return object; }; /** - * Converts this ListSnapshotsResponse to JSON. + * Converts this ColumnFamily to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.ListSnapshotsResponse + * @memberof google.bigtable.admin.v2.ColumnFamily * @instance * @returns {Object.} JSON object */ - ListSnapshotsResponse.prototype.toJSON = function toJSON() { + ColumnFamily.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSnapshotsResponse; + return ColumnFamily; })(); - v2.DeleteSnapshotRequest = (function() { + v2.GcRule = (function() { /** - * Properties of a DeleteSnapshotRequest. + * Properties of a GcRule. * @memberof google.bigtable.admin.v2 - * @interface IDeleteSnapshotRequest - * @property {string|null} [name] DeleteSnapshotRequest name + * @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 DeleteSnapshotRequest. + * Constructs a new GcRule. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a DeleteSnapshotRequest. - * @implements IDeleteSnapshotRequest + * @classdesc Represents a GcRule. + * @implements IGcRule * @constructor - * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set */ - function DeleteSnapshotRequest(properties) { + function GcRule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13750,75 +13328,128 @@ } /** - * DeleteSnapshotRequest name. - * @member {string} name - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * GcRule maxNumVersions. + * @member {number} maxNumVersions + * @memberof google.bigtable.admin.v2.GcRule * @instance */ - DeleteSnapshotRequest.prototype.name = ""; + GcRule.prototype.maxNumVersions = 0; /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. + * 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.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static - * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest instance + * @param {google.bigtable.admin.v2.IGcRule=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.GcRule} GcRule instance */ - DeleteSnapshotRequest.create = function create(properties) { - return new DeleteSnapshotRequest(properties); + GcRule.create = function create(properties) { + return new GcRule(properties); }; /** - * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * Encodes the specified GcRule message. Does not implicitly {@link google.bigtable.admin.v2.GcRule.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static - * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @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 */ - DeleteSnapshotRequest.encode = function encode(message, writer) { + GcRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.maxNumVersions != null && message.hasOwnProperty("maxNumVersions")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxNumVersions); + if (message.maxAge != null && message.hasOwnProperty("maxAge")) + $root.google.protobuf.Duration.encode(message.maxAge, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intersection != null && message.hasOwnProperty("intersection")) + $root.google.bigtable.admin.v2.GcRule.Intersection.encode(message.intersection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.union != null && message.hasOwnProperty("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 DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.DeleteSnapshotRequest.verify|verify} messages. + * 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.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static - * @param {google.bigtable.admin.v2.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @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 */ - DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + GcRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * Decodes a GcRule message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @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.DeleteSnapshotRequest} DeleteSnapshotRequest + * @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 */ - DeleteSnapshotRequest.decode = function decode(reader, length) { + GcRule.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -13829,356 +13460,593 @@ }; /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a GcRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @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 */ - DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + GcRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSnapshotRequest message. + * Verifies a GcRule message. * @function verify - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @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 */ - DeleteSnapshotRequest.verify = function verify(message) { + GcRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + var properties = {}; + if (message.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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GcRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.DeleteSnapshotRequest} DeleteSnapshotRequest + * @returns {google.bigtable.admin.v2.GcRule} GcRule */ - DeleteSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.DeleteSnapshotRequest) + GcRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.GcRule) return object; - var message = new $root.google.bigtable.admin.v2.DeleteSnapshotRequest(); - if (object.name != null) - message.name = String(object.name); + 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 DeleteSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a GcRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @static - * @param {google.bigtable.admin.v2.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {google.bigtable.admin.v2.GcRule} message GcRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSnapshotRequest.toObject = function toObject(message, options) { + GcRule.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.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 DeleteSnapshotRequest to JSON. + * Converts this GcRule to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.DeleteSnapshotRequest + * @memberof google.bigtable.admin.v2.GcRule * @instance * @returns {Object.} JSON object */ - DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + GcRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteSnapshotRequest; - })(); + GcRule.Intersection = (function() { - v2.SnapshotTableMetadata = (function() { + /** + * Properties of an Intersection. + * @memberof google.bigtable.admin.v2.GcRule + * @interface IIntersection + * @property {Array.|null} [rules] Intersection rules + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * Intersection rules. + * @member {Array.} rules + * @memberof google.bigtable.admin.v2.GcRule.Intersection + * @instance + */ + Intersection.prototype.rules = $util.emptyArray; - /** - * SnapshotTableMetadata originalRequest. - * @member {google.bigtable.admin.v2.ISnapshotTableRequest|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.SnapshotTableMetadata - * @instance - */ - SnapshotTableMetadata.prototype.originalRequest = null; + /** + * 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); + }; - /** - * SnapshotTableMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.SnapshotTableMetadata - * @instance - */ - SnapshotTableMetadata.prototype.requestTime = null; + /** + * 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; + }; - /** - * SnapshotTableMetadata finishTime. - * @member {google.protobuf.ITimestamp|null|undefined} finishTime - * @memberof google.bigtable.admin.v2.SnapshotTableMetadata - * @instance - */ - SnapshotTableMetadata.prototype.finishTime = null; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + 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; + }; - /** - * 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 && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.SnapshotTableRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * 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()); + }; - /** - * 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - 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; + /** + * 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); + }; + + 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) { + 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(); + 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 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()); - }; + return null; + }; - /** - * 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 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 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) + /** + * 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; - 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 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); + }; - /** - * 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); - }; + return Union; + })(); - return SnapshotTableMetadata; + return GcRule; })(); - v2.CreateTableFromSnapshotMetadata = (function() { + v2.Snapshot = (function() { /** - * Properties of a CreateTableFromSnapshotMetadata. + * Properties of a Snapshot. * @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 + * @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 CreateTableFromSnapshotMetadata. + * Constructs a new Snapshot. * @memberof google.bigtable.admin.v2 - * @classdesc Represents a CreateTableFromSnapshotMetadata. - * @implements ICreateTableFromSnapshotMetadata + * @classdesc Represents a Snapshot. + * @implements ISnapshot * @constructor - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set */ - function CreateTableFromSnapshotMetadata(properties) { + function Snapshot(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14186,101 +14054,153 @@ } /** - * CreateTableFromSnapshotMetadata originalRequest. - * @member {google.bigtable.admin.v2.ICreateTableFromSnapshotRequest|null|undefined} originalRequest - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * Snapshot name. + * @member {string} name + * @memberof google.bigtable.admin.v2.Snapshot * @instance */ - CreateTableFromSnapshotMetadata.prototype.originalRequest = null; + Snapshot.prototype.name = ""; /** - * CreateTableFromSnapshotMetadata requestTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestTime - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * Snapshot sourceTable. + * @member {google.bigtable.admin.v2.ITable|null|undefined} sourceTable + * @memberof google.bigtable.admin.v2.Snapshot * @instance */ - CreateTableFromSnapshotMetadata.prototype.requestTime = null; + Snapshot.prototype.sourceTable = null; /** - * CreateTableFromSnapshotMetadata finishTime. - * @member {google.protobuf.ITimestamp|null|undefined} finishTime - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * Snapshot dataSizeBytes. + * @member {number|Long} dataSizeBytes + * @memberof google.bigtable.admin.v2.Snapshot * @instance */ - CreateTableFromSnapshotMetadata.prototype.finishTime = null; + Snapshot.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new CreateTableFromSnapshotMetadata instance using the specified properties. + * 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.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata=} [properties] Properties to set - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata instance + * @param {google.bigtable.admin.v2.ISnapshot=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot instance */ - CreateTableFromSnapshotMetadata.create = function create(properties) { - return new CreateTableFromSnapshotMetadata(properties); + Snapshot.create = function create(properties) { + return new Snapshot(properties); }; /** - * Encodes the specified CreateTableFromSnapshotMetadata message. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * Encodes the specified Snapshot message. Does not implicitly {@link google.bigtable.admin.v2.Snapshot.verify|verify} messages. * @function encode - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @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 */ - CreateTableFromSnapshotMetadata.encode = function encode(message, writer) { + Snapshot.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalRequest != null && message.hasOwnProperty("originalRequest")) - $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.encode(message.originalRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestTime != null && message.hasOwnProperty("requestTime")) - $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.finishTime != null && message.hasOwnProperty("finishTime")) - $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceTable != null && message.hasOwnProperty("sourceTable")) + $root.google.bigtable.admin.v2.Table.encode(message.sourceTable, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.dataSizeBytes); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); return writer; }; /** - * Encodes the specified CreateTableFromSnapshotMetadata message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.verify|verify} messages. + * 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.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static - * @param {google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata message or plain object to encode + * @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 */ - CreateTableFromSnapshotMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer. + * Decodes a Snapshot message from the specified reader or buffer. * @function decode - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @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.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @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 */ - CreateTableFromSnapshotMetadata.decode = function decode(reader, length) { + Snapshot.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: - message.originalRequest = $root.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.requestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.sourceTable = $root.google.bigtable.admin.v2.Table.decode(reader, reader.uint32()); break; case 3: - message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + 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); @@ -14291,119 +14211,199 @@ }; /** - * Decodes a CreateTableFromSnapshotMetadata message from the specified reader or buffer, length delimited. + * Decodes a Snapshot message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @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 */ - CreateTableFromSnapshotMetadata.decodeDelimited = function decodeDelimited(reader) { + Snapshot.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTableFromSnapshotMetadata message. + * Verifies a Snapshot message. * @function verify - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @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 */ - CreateTableFromSnapshotMetadata.verify = function verify(message) { + Snapshot.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 (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 "originalRequest." + error; + return "sourceTable." + error; } - if (message.requestTime != null && message.hasOwnProperty("requestTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.requestTime); + 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 "requestTime." + error; + return "createTime." + error; } - if (message.finishTime != null && message.hasOwnProperty("finishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); if (error) - return "finishTime." + 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 CreateTableFromSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static * @param {Object.} object Plain object - * @returns {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} CreateTableFromSnapshotMetadata + * @returns {google.bigtable.admin.v2.Snapshot} Snapshot */ - CreateTableFromSnapshotMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.Snapshot) 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); + 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.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.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.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); + 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) { + 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 CreateTableFromSnapshotMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. * @function toObject - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @static - * @param {google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} message CreateTableFromSnapshotMetadata + * @param {google.bigtable.admin.v2.Snapshot} message Snapshot * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTableFromSnapshotMetadata.toObject = function toObject(message, options) { + Snapshot.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalRequest = null; - object.requestTime = null; - object.finishTime = null; + 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.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); + 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] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; return object; }; /** - * Converts this CreateTableFromSnapshotMetadata to JSON. + * Converts this Snapshot to JSON. * @function toJSON - * @memberof google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + * @memberof google.bigtable.admin.v2.Snapshot * @instance * @returns {Object.} JSON object */ - CreateTableFromSnapshotMetadata.prototype.toJSON = function toJSON() { + Snapshot.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateTableFromSnapshotMetadata; + /** + * State enum. + * @name google.bigtable.admin.v2.Snapshot.State + * @enum {string} + * @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; })(); return v2; @@ -34007,230 +34007,6 @@ return GeneratedCodeInfo; })(); - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - protobuf.Timestamp = (function() { /** @@ -34674,6 +34450,230 @@ return Any; })(); + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + protobuf.Empty = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index c6e05efb3..3d985b3b4 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -11,183 +11,11 @@ "csharp_namespace": "Google.Cloud.Bigtable.Admin.V2", "go_package": "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin", "java_multiple_files": true, - "java_outer_classname": "BigtableTableAdminProto", + "java_outer_classname": "TableProto", "java_package": "com.google.bigtable.admin.v2", "php_namespace": "Google\\Cloud\\Bigtable\\Admin\\V2" }, "nested": { - "Table": { - "options": { - "(google.api.resource).type": "bigtable.googleapis.com/Table", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "clusterStates": { - "keyType": "string", - "type": "ClusterState", - "id": 2 - }, - "columnFamilies": { - "keyType": "string", - "type": "ColumnFamily", - "id": 3 - }, - "granularity": { - "type": "TimestampGranularity", - "id": 4 - } - }, - "nested": { - "ClusterState": { - "fields": { - "replicationState": { - "type": "ReplicationState", - "id": 1 - } - }, - "nested": { - "ReplicationState": { - "values": { - "STATE_NOT_KNOWN": 0, - "INITIALIZING": 1, - "PLANNED_MAINTENANCE": 2, - "UNPLANNED_MAINTENANCE": 3, - "READY": 4 - } - } - } - }, - "TimestampGranularity": { - "values": { - "TIMESTAMP_GRANULARITY_UNSPECIFIED": 0, - "MILLIS": 1 - } - }, - "View": { - "values": { - "VIEW_UNSPECIFIED": 0, - "NAME_ONLY": 1, - "SCHEMA_VIEW": 2, - "REPLICATION_VIEW": 3, - "FULL": 4 - } - } - } - }, - "ColumnFamily": { - "fields": { - "gcRule": { - "type": "GcRule", - "id": 1 - } - } - }, - "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 - } - } - } - } - }, - "Snapshot": { - "options": { - "(google.api.resource).type": "bigtable.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 - }, - "dataSizeBytes": { - "type": "int64", - "id": 3 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "state": { - "type": "State", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - } - }, - "nested": { - "State": { - "values": { - "STATE_NOT_KNOWN": 0, - "READY": 1, - "CREATING": 2 - } - } - } - }, - "StorageType": { - "values": { - "STORAGE_TYPE_UNSPECIFIED": 0, - "SSD": 1, - "HDD": 2 - } - }, "BigtableInstanceAdmin": { "options": { "(google.api.default_host)": "bigtableadmin.googleapis.com", @@ -900,6 +728,13 @@ } } }, + "StorageType": { + "values": { + "STORAGE_TYPE_UNSPECIFIED": 0, + "SSD": 1, + "HDD": 2 + } + }, "BigtableTableAdmin": { "options": { "(google.api.default_host)": "bigtableadmin.googleapis.com", @@ -1435,6 +1270,171 @@ "id": 3 } } + }, + "Table": { + "options": { + "(google.api.resource).type": "bigtable.googleapis.com/Table", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/tables/{table}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "clusterStates": { + "keyType": "string", + "type": "ClusterState", + "id": 2 + }, + "columnFamilies": { + "keyType": "string", + "type": "ColumnFamily", + "id": 3 + }, + "granularity": { + "type": "TimestampGranularity", + "id": 4 + } + }, + "nested": { + "ClusterState": { + "fields": { + "replicationState": { + "type": "ReplicationState", + "id": 1 + } + }, + "nested": { + "ReplicationState": { + "values": { + "STATE_NOT_KNOWN": 0, + "INITIALIZING": 1, + "PLANNED_MAINTENANCE": 2, + "UNPLANNED_MAINTENANCE": 3, + "READY": 4 + } + } + } + }, + "TimestampGranularity": { + "values": { + "TIMESTAMP_GRANULARITY_UNSPECIFIED": 0, + "MILLIS": 1 + } + }, + "View": { + "values": { + "VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "SCHEMA_VIEW": 2, + "REPLICATION_VIEW": 3, + "FULL": 4 + } + } + } + }, + "ColumnFamily": { + "fields": { + "gcRule": { + "type": "GcRule", + "id": 1 + } + } + }, + "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 + } + } + } + } + }, + "Snapshot": { + "options": { + "(google.api.resource).type": "bigtable.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 + }, + "dataSizeBytes": { + "type": "int64", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "state": { + "type": "State", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2 + } + } + } } } } @@ -2263,7 +2263,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ClientProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -2356,6 +2356,22 @@ } } }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", @@ -2437,22 +2453,6 @@ "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" } } }, @@ -3347,7 +3347,7 @@ } } }, - "Duration": { + "Timestamp": { "fields": { "seconds": { "type": "int64", @@ -3359,26 +3359,26 @@ } } }, - "Timestamp": { + "Any": { "fields": { - "seconds": { - "type": "int64", + "type_url": { + "type": "string", "id": 1 }, - "nanos": { - "type": "int32", + "value": { + "type": "bytes", "id": 2 } } }, - "Any": { + "Duration": { "fields": { - "type_url": { - "type": "string", + "seconds": { + "type": "int64", "id": 1 }, - "value": { - "type": "bytes", + "nanos": { + "type": "int32", "id": 2 } } diff --git a/src/service_proto_list.json b/src/service_proto_list.json deleted file mode 100644 index 66dec4085..000000000 --- a/src/service_proto_list.json +++ /dev/null @@ -1 +0,0 @@ -["../protos/google/bigtable/admin/v2/table.proto", "../protos/google/bigtable/admin/v2/common.proto", "../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto", "../protos/google/bigtable/admin/v2/instance.proto", "../protos/google/bigtable/admin/v2/bigtable_table_admin.proto"] \ No newline at end of file diff --git a/src/v2/bigtable_client.js b/src/v2/bigtable_client.ts similarity index 54% rename from src/v2/bigtable_client.js rename to src/v2/bigtable_client.ts index 8f58d0abe..b0d327025 100644 --- a/src/v2/bigtable_client.js +++ b/src/v2/bigtable_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,22 +11,44 @@ // WITHOUT 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'; +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; -const gapicConfig = require('./bigtable_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './bigtable_client_config.json'; -const VERSION = require('../../../package.json').version; +const version = require('../../../package.json').version; /** - * Service for reading from and writing to existing Bigtable tables. - * + * Service for reading from and writing to existing Bigtable tables. * @class * @memberof v2 */ -class BigtableClient { +export class BigtableClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + bigtableStub?: Promise<{[name: string]: Function}>; + /** * Construct an instance of BigtableClient. * @@ -49,63 +71,61 @@ class BigtableClient { * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof BigtableClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + opts.scopes = (this.constructor as typeof BigtableClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = []; - + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } - clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } - // Load the applicable protos. // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. @@ -117,7 +137,7 @@ class BigtableClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -125,7 +145,7 @@ class BigtableClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - tablePathTemplate: new gaxModule.PathTemplate( + tablePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/instances/{instance}/tables/{table}' ), }; @@ -133,20 +153,22 @@ class BigtableClient { // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this._descriptors.stream = { - readRows: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING), - sampleRowKeys: new gaxModule.StreamDescriptor( + readRows: new this._gaxModule.StreamDescriptor( gax.StreamType.SERVER_STREAMING ), - mutateRows: new gaxModule.StreamDescriptor( + sampleRowKeys: new this._gaxModule.StreamDescriptor( + gax.StreamType.SERVER_STREAMING + ), + mutateRows: new this._gaxModule.StreamDescriptor( gax.StreamType.SERVER_STREAMING ), }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.bigtable.v2.Bigtable', - gapicConfig, - opts.clientConfig, + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')} ); @@ -154,15 +176,36 @@ class BigtableClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.bigtableStub) { + return this.bigtableStub; + } // Put together the "service stub" for // google.bigtable.v2.Bigtable. - const bigtableStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.bigtable.v2.Bigtable') - : protos.google.bigtable.v2.Bigtable, - opts - ); + this.bigtableStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.bigtable.v2.Bigtable' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.bigtable.v2.Bigtable, + this._opts + ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. @@ -174,21 +217,38 @@ class BigtableClient { 'checkAndMutateRow', 'readModifyWriteRow', ]; + for (const methodName of bigtableStubMethods) { - const innerCallPromise = bigtableStub.then( - stub => (...args) => { + const innerCallPromise = this.bigtableStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, - err => () => { + (err: Error | null | undefined) => () => { throw err; } ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( + + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], - this._descriptors.stream[methodName] + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; } + + return this.bigtableStub; } /** @@ -228,248 +288,329 @@ class BigtableClient { ]; } + getProjectId(): Promise; + getProjectId(callback: Callback): void; /** * Return the project ID used by this class. * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback) { - return this.auth.getProjectId(callback); + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); } // ------------------- // -- Service calls -- // ------------------- - + mutateRow( + request: protosTypes.google.bigtable.v2.IMutateRowRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.v2.IMutateRowResponse, + protosTypes.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined + ] + >; + mutateRow( + request: protosTypes.google.bigtable.v2.IMutateRowRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.v2.IMutateRowResponse, + protosTypes.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined + > + ): void; /** - * 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. + * 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 - * Required. The unique name of the table from which to read. + * Required. The unique name of the table to which the mutation should be applied. * Values are of the form * `projects//instances//tables/`. - * @param {string} [request.appProfileId] + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [request.rows] - * The row keys and/or ranges to read. If not specified, reads from all rows. - * - * This object should have the same structure as [RowSet]{@link google.bigtable.v2.RowSet} - * @param {Object} [request.filter] - * The filter to apply to the contents of the specified row(s). If unset, - * reads the entirety of each row. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * @param {number} [request.rowsLimit] - * The read will terminate after committing to N rows' worth of results. The - * default (zero) is to return all results. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits [ReadRowsResponse]{@link google.bigtable.v2.ReadRowsResponse} on 'data' event. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.readRows({tableName: formattedTableName}).on('data', response => { - * // doThingsWith(response) - * }); + * @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 {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 [MutateRowResponse]{@link google.bigtable.v2.MutateRowResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. */ - readRows(request, options) { + mutateRow( + request: protosTypes.google.bigtable.v2.IMutateRowRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.v2.IMutateRowResponse, + protosTypes.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.v2.IMutateRowResponse, + protosTypes.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.v2.IMutateRowResponse, + protosTypes.google.bigtable.v2.IMutateRowRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.readRows(request, options); + this.initialize(); + return this._innerApiCalls.mutateRow(request, options, callback); } - + checkAndMutateRow( + request: protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.v2.ICheckAndMutateRowResponse, + protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined + ] + >; + checkAndMutateRow( + request: protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.v2.ICheckAndMutateRowResponse, + protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined + > + ): 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. + * 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 - * Required. The unique name of the table from which to sample row keys. + * Required. 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.appProfileId] + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits [SampleRowKeysResponse]{@link google.bigtable.v2.SampleRowKeysResponse} on 'data' event. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.sampleRowKeys({tableName: formattedTableName}).on('data', response => { - * // doThingsWith(response) - * }); + * @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 [CheckAndMutateRowResponse]{@link google.bigtable.v2.CheckAndMutateRowResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. */ - sampleRowKeys(request, options) { + checkAndMutateRow( + request: protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.v2.ICheckAndMutateRowResponse, + protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.v2.ICheckAndMutateRowResponse, + protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.v2.ICheckAndMutateRowResponse, + protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.sampleRowKeys(request, options); + this.initialize(); + return this._innerApiCalls.checkAndMutateRow(request, options, callback); } - + readModifyWriteRow( + request: protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.v2.IReadModifyWriteRowResponse, + protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined + ] + >; + readModifyWriteRow( + request: protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.v2.IReadModifyWriteRowResponse, + protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined + > + ): void; /** - * Mutates a row atomically. Cells already present in the row are left - * unchanged unless explicitly changed by `mutation`. + * 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 - * Required. The unique name of the table to which the mutation should be applied. + * Required. 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 {Buffer} request.rowKey - * Required. The key of the row to which the mutation should be applied. - * @param {Object[]} 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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * @param {string} [request.appProfileId] + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [MutateRowResponse]{@link google.bigtable.v2.MutateRowResponse}. + * @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. + * @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 [MutateRowResponse]{@link google.bigtable.v2.MutateRowResponse}. + * The first element of the array is an object representing [ReadModifyWriteRowResponse]{@link google.bigtable.v2.ReadModifyWriteRowResponse}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const rowKey = Buffer.from(''); - * const mutations = []; - * const request = { - * tableName: formattedTableName, - * rowKey: rowKey, - * mutations: mutations, - * }; - * client.mutateRow(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - mutateRow(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + readModifyWriteRow( + request: protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.v2.IReadModifyWriteRowResponse, + protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.v2.IReadModifyWriteRowResponse, + protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.v2.IReadModifyWriteRowResponse, + protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.mutateRow(request, options, callback); + this.initialize(); + return this._innerApiCalls.readModifyWriteRow(request, options, callback); } /** - * Mutates multiple rows in a batch. Each individual row is mutated - * atomically as in MutateRow, but the entire batch is not executed - * atomically. + * 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 - * Required. The unique name of the table to which the mutations should be applied. - * @param {Object[]} 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. - * - * This object should have the same structure as [Entry]{@link google.bigtable.v2.Entry} - * @param {string} [request.appProfileId] + * Required. The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {google.bigtable.v2.RowSet} request.rows + * The row keys and/or ranges to read. 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 terminate after committing to N rows' worth of results. The + * default (zero) is to return all results. + * @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 [MutateRowsResponse]{@link google.bigtable.v2.MutateRowsResponse} on 'data' event. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const entries = []; - * const request = { - * tableName: formattedTableName, - * entries: entries, - * }; - * client.mutateRows(request).on('data', response => { - * // doThingsWith(response) - * }); + * An object stream which emits [ReadRowsResponse]{@link google.bigtable.v2.ReadRowsResponse} on 'data' event. */ - mutateRows(request, options) { + readRows( + request?: protosTypes.google.bigtable.v2.IReadRowsRequest, + options?: gax.CallOptions + ): gax.CancellableStream { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -477,89 +618,36 @@ class BigtableClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.mutateRows(request, options); + this.initialize(); + return this._innerApiCalls.readRows(request, options); } /** - * Mutates a row atomically based on the output of a predicate Reader filter. + * 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 - * Required. The unique name of the table to which the conditional mutation should be - * applied. + * Required. The unique name of the table from which to sample row keys. * Values are of the form * `projects//instances//tables/
`. - * @param {Buffer} request.rowKey - * Required. The key of the row to which the conditional mutation should be applied. - * @param {string} [request.appProfileId] + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * @param {Object[]} [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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * @param {Object[]} [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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [CheckAndMutateRowResponse]{@link google.bigtable.v2.CheckAndMutateRowResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CheckAndMutateRowResponse]{@link google.bigtable.v2.CheckAndMutateRowResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const rowKey = Buffer.from(''); - * const request = { - * tableName: formattedTableName, - * rowKey: rowKey, - * }; - * client.checkAndMutateRow(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * @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 [SampleRowKeysResponse]{@link google.bigtable.v2.SampleRowKeysResponse} on 'data' event. */ - checkAndMutateRow(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } + sampleRowKeys( + request?: protosTypes.google.bigtable.v2.ISampleRowKeysRequest, + options?: gax.CallOptions + ): gax.CancellableStream { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -567,78 +655,39 @@ class BigtableClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.checkAndMutateRow(request, options, callback); + this.initialize(); + return this._innerApiCalls.sampleRowKeys(request, options); } /** - * 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. + * 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 - * Required. 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 {Buffer} request.rowKey - * Required. The key of the row to which the read/modify/write rules should be applied. - * @param {Object[]} 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. - * - * This object should have the same structure as [ReadModifyWriteRule]{@link google.bigtable.v2.ReadModifyWriteRule} - * @param {string} [request.appProfileId] + * Required. The unique name of the table to which the mutations should be applied. + * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ReadModifyWriteRowResponse]{@link google.bigtable.v2.ReadModifyWriteRowResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadModifyWriteRowResponse]{@link google.bigtable.v2.ReadModifyWriteRowResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const bigtable = require('@google-cloud/bigtable'); - * - * const client = new bigtable.v2.BigtableClient({ - * // optional auth parameters. - * }); - * - * const formattedTableName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const rowKey = Buffer.from(''); - * const rules = []; - * const request = { - * tableName: formattedTableName, - * rowKey: rowKey, - * rules: rules, - * }; - * client.readModifyWriteRow(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * @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 [MutateRowsResponse]{@link google.bigtable.v2.MutateRowsResponse} on 'data' event. */ - readModifyWriteRow(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } + mutateRows( + request?: protosTypes.google.bigtable.v2.IMutateRowsRequest, + options?: gax.CallOptions + ): gax.CancellableStream { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -646,10 +695,10 @@ class BigtableClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_name: request.tableName, + table_name: request.tableName || '', }); - - return this._innerApiCalls.readModifyWriteRow(request, options, callback); + this.initialize(); + return this._innerApiCalls.mutateRows(request, options); } // -------------------- @@ -659,51 +708,65 @@ class BigtableClient { /** * Return a fully-qualified table resource name string. * - * @param {String} project - * @param {String} instance - * @param {String} table - * @returns {String} + * @param {string} project + * @param {string} instance + * @param {string} table + * @returns {string} Resource name string. */ - tablePath(project, instance, table) { + tablePath(project: string, instance: string, table: string) { return this._pathTemplates.tablePathTemplate.render({ - project: project, - instance: instance, - table: table, + project, + instance, + table, }); } /** - * Parse the tableName from a table resource. + * Parse the project from Table resource. * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the project. + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. */ - matchProjectFromTableName(tableName) { + matchProjectFromTableName(tableName: string) { return this._pathTemplates.tablePathTemplate.match(tableName).project; } /** - * Parse the tableName from a table resource. + * Parse the instance from Table resource. * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the instance. + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the instance. */ - matchInstanceFromTableName(tableName) { + matchInstanceFromTableName(tableName: string) { return this._pathTemplates.tablePathTemplate.match(tableName).instance; } /** - * Parse the tableName from a table resource. + * Parse the table from Table resource. * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the table. + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. */ - matchTableFromTableName(tableName) { + matchTableFromTableName(tableName: string) { return this._pathTemplates.tablePathTemplate.match(tableName).table; } -} -module.exports = BigtableClient; + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.bigtableStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v2/bigtable_client_config.json b/src/v2/bigtable_client_config.json index 51f325943..67a35c0bd 100644 --- a/src/v2/bigtable_client_config.json +++ b/src/v2/bigtable_client_config.json @@ -2,46 +2,28 @@ "interfaces": { "google.bigtable.v2.Bigtable": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { - "idempotent_params": { - "initial_retry_delay_millis": 10, - "retry_delay_multiplier": 2.0, + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 }, - "non_idempotent_params": { - "initial_retry_delay_millis": 10, - "retry_delay_multiplier": 2.0, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - }, - "read_rows_params": { - "initial_retry_delay_millis": 10, - "retry_delay_multiplier": 2.0, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 43200000 - }, - "mutate_rows_params": { + "5af39a0f6db447f61c4f695240caeccb74f78362": { "initial_retry_delay_millis": 10, - "retry_delay_multiplier": 2.0, + "retry_delay_multiplier": 2, "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } @@ -50,32 +32,32 @@ "ReadRows": { "timeout_millis": 43200000, "retry_codes_name": "idempotent", - "retry_params_name": "read_rows_params" + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" }, "SampleRowKeys": { "timeout_millis": 20000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" }, "MutateRow": { "timeout_millis": 20000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" }, "MutateRows": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "mutate_rows_params" + "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" }, "CheckAndMutateRow": { "timeout_millis": 20000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "ReadModifyWriteRow": { "timeout_millis": 20000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" } } } diff --git a/src/v2/bigtable_instance_admin_client.js b/src/v2/bigtable_instance_admin_client.js deleted file mode 100644 index 017488ebb..000000000 --- a/src/v2/bigtable_instance_admin_client.js +++ /dev/null @@ -1,2160 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const gapicConfig = require('./bigtable_instance_admin_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -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 - */ -class BigtableInstanceAdminClient { - /** - * Construct an instance of BigtableInstanceAdminClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - appProfilePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' - ), - clusterPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}' - ), - instancePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - locationPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'appProfiles' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const createInstanceResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Instance' - ); - const createInstanceMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.CreateInstanceMetadata' - ); - const partialUpdateInstanceResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Instance' - ); - const partialUpdateInstanceMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.UpdateInstanceMetadata' - ); - const createClusterResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Cluster' - ); - const createClusterMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.CreateClusterMetadata' - ); - const updateClusterResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Cluster' - ); - const updateClusterMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.UpdateClusterMetadata' - ); - const updateAppProfileResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.AppProfile' - ); - const updateAppProfileMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.UpdateAppProfileMetadata' - ); - - this._descriptors.longrunning = { - createInstance: new gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata) - ), - partialUpdateInstance: new gaxModule.LongrunningDescriptor( - this.operationsClient, - partialUpdateInstanceResponse.decode.bind( - partialUpdateInstanceResponse - ), - partialUpdateInstanceMetadata.decode.bind(partialUpdateInstanceMetadata) - ), - createCluster: new gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata) - ), - updateCluster: new gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata) - ), - updateAppProfile: new gaxModule.LongrunningDescriptor( - this.operationsClient, - updateAppProfileResponse.decode.bind(updateAppProfileResponse), - updateAppProfileMetadata.decode.bind(updateAppProfileMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.bigtable.admin.v2.BigtableInstanceAdmin', - gapicConfig, - opts.clientConfig, - {'x-goog-api-client': clientHeader.join(' ')} - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this._innerApiCalls = {}; - - // Put together the "service stub" for - // google.bigtable.admin.v2.BigtableInstanceAdmin. - const bigtableInstanceAdminStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.bigtable.admin.v2.BigtableInstanceAdmin') - : protos.google.bigtable.admin.v2.BigtableInstanceAdmin, - opts - ); - - // 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', - 'deleteCluster', - 'createAppProfile', - 'getAppProfile', - 'listAppProfiles', - 'updateAppProfile', - 'deleteAppProfile', - 'getIamPolicy', - 'setIamPolicy', - 'testIamPermissions', - ]; - for (const methodName of bigtableInstanceAdminStubMethods) { - const innerCallPromise = bigtableInstanceAdminStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.cluster', - 'https://www.googleapis.com/auth/bigtable.admin.instance', - 'https://www.googleapis.com/auth/bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', - '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', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Create an instance within a project. - * - * @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 {Object} request.instance - * Required. The instance to create. - * Fields marked `OutputOnly` must be left blank. - * - * This object should have the same structure as [Instance]{@link google.bigtable.admin.v2.Instance} - * @param {Object.} 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. - * Currently, at most four clusters can be specified. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const instanceId = ''; - * const instance = {}; - * const clusters = {}; - * const request = { - * parent: formattedParent, - * instanceId: instanceId, - * instance: instance, - * clusters: clusters, - * }; - * - * // Handle the operation using the promise pattern. - * client.createInstance(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const instanceId = ''; - * const instance = {}; - * const clusters = {}; - * const request = { - * parent: formattedParent, - * instanceId: instanceId, - * instance: instance, - * clusters: clusters, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.createInstance(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const instanceId = ''; - * const instance = {}; - * const clusters = {}; - * const request = { - * parent: formattedParent, - * instanceId: instanceId, - * instance: instance, - * clusters: clusters, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.createInstance(request); - * - * const [response] = await operation.promise(); - */ - createInstance(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createInstance(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.getInstance({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getInstance(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getInstance(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ListInstancesResponse]{@link google.bigtable.admin.v2.ListInstancesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListInstancesResponse]{@link google.bigtable.admin.v2.ListInstancesResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * client.listInstances({parent: formattedParent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listInstances(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listInstances(request, options, callback); - } - - /** - * 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/[a-z][a-z0-9\\-]+[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 {number} request.type - * The type of the instance. Defaults to `PRODUCTION`. - * - * The number should be among the values of [Type]{@link google.bigtable.admin.v2.Type} - * @param {Object.} 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: `[\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 {number} [request.state] - * (`OutputOnly`) - * The current state of the instance. - * - * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const displayName = ''; - * const type = 'TYPE_UNSPECIFIED'; - * const labels = {}; - * const request = { - * name: formattedName, - * displayName: displayName, - * type: type, - * labels: labels, - * }; - * client.updateInstance(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateInstance(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateInstance(request, options, callback); - } - - /** - * 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 {Object} request.instance - * Required. The Instance which will (partially) replace the current value. - * - * This object should have the same structure as [Instance]{@link google.bigtable.admin.v2.Instance} - * @param {Object} request.updateMask - * Required. The subset of Instance fields which should be replaced. - * Must be explicitly set. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const instance = {}; - * const updateMask = {}; - * const request = { - * instance: instance, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the promise pattern. - * client.partialUpdateInstance(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const instance = {}; - * const updateMask = {}; - * const request = { - * instance: instance, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.partialUpdateInstance(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const instance = {}; - * const updateMask = {}; - * const request = { - * instance: instance, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.partialUpdateInstance(request); - * - * const [response] = await operation.promise(); - */ - partialUpdateInstance(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance.name, - }); - - return this._innerApiCalls.partialUpdateInstance( - request, - options, - callback - ); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.deleteInstance({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteInstance(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteInstance(request, options, callback); - } - - /** - * Creates a cluster 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 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 {Object} request.cluster - * Required. The cluster to be created. - * Fields marked `OutputOnly` must be left blank. - * - * This object should have the same structure as [Cluster]{@link google.bigtable.admin.v2.Cluster} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const clusterId = ''; - * const cluster = {}; - * const request = { - * parent: formattedParent, - * clusterId: clusterId, - * cluster: cluster, - * }; - * - * // Handle the operation using the promise pattern. - * client.createCluster(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const clusterId = ''; - * const cluster = {}; - * const request = { - * parent: formattedParent, - * clusterId: clusterId, - * cluster: cluster, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.createCluster(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const clusterId = ''; - * const cluster = {}; - * const request = { - * parent: formattedParent, - * clusterId: clusterId, - * cluster: cluster, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.createCluster(request); - * - * const [response] = await operation.promise(); - */ - createCluster(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createCluster(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Cluster]{@link google.bigtable.admin.v2.Cluster}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Cluster]{@link google.bigtable.admin.v2.Cluster}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * client.getCluster({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getCluster(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getCluster(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ListClustersResponse]{@link google.bigtable.admin.v2.ListClustersResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListClustersResponse]{@link google.bigtable.admin.v2.ListClustersResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.listClusters({parent: formattedParent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listClusters(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listClusters(request, options, callback); - } - - /** - * Updates a cluster within an instance. - * - * @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/[a-z][-a-z0-9]*`. - * @param {number} request.serveNodes - * Required. The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. - * @param {string} [request.location] - * (`CreationOnly`) - * 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 {number} [request.state] - * The current state of the cluster. - * - * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} - * @param {number} [request.defaultStorageType] - * (`CreationOnly`) - * The type of storage used by this cluster to serve its - * parent instance's tables, unless explicitly overridden. - * - * The number should be among the values of [StorageType]{@link google.bigtable.admin.v2.StorageType} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * const serveNodes = 0; - * const request = { - * name: formattedName, - * serveNodes: serveNodes, - * }; - * - * // Handle the operation using the promise pattern. - * client.updateCluster(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * const serveNodes = 0; - * const request = { - * name: formattedName, - * serveNodes: serveNodes, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.updateCluster(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * const serveNodes = 0; - * const request = { - * name: formattedName, - * serveNodes: serveNodes, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.updateCluster(request); - * - * const [response] = await operation.promise(); - */ - updateCluster(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateCluster(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * client.deleteCluster({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteCluster(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteCluster(request, options, callback); - } - - /** - * 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 {Object} request.appProfile - * Required. The app profile to be created. - * Fields marked `OutputOnly` will be ignored. - * - * This object should have the same structure as [AppProfile]{@link google.bigtable.admin.v2.AppProfile} - * @param {boolean} [request.ignoreWarnings] - * If true, ignore safety checks when creating the app profile. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const appProfileId = ''; - * const appProfile = {}; - * const request = { - * parent: formattedParent, - * appProfileId: appProfileId, - * appProfile: appProfile, - * }; - * client.createAppProfile(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createAppProfile(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createAppProfile(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - * client.getAppProfile({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getAppProfile(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getAppProfile(request, options, callback); - } - - /** - * 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 {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListAppProfilesResponse]{@link google.bigtable.admin.v2.ListAppProfilesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [AppProfile]{@link google.bigtable.admin.v2.AppProfile} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListAppProfilesResponse]{@link google.bigtable.admin.v2.ListAppProfilesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * - * client.listAppProfiles({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listAppProfiles(nextRequest, options).then(callback); - * } - * } - * client.listAppProfiles({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listAppProfiles(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listAppProfiles(request, options, callback); - } - - /** - * Equivalent to {@link listAppProfiles}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAppProfiles} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The 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 {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile} on 'data' event. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.listAppProfilesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listAppProfilesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listAppProfiles.createStream( - this._innerApiCalls.listAppProfiles, - request, - options - ); - } - - /** - * Updates an app profile within an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.appProfile - * Required. The app profile which will (partially) replace the current value. - * - * This object should have the same structure as [AppProfile]{@link google.bigtable.admin.v2.AppProfile} - * @param {Object} request.updateMask - * Required. The subset of app profile fields which should be replaced. - * If unset, all fields will be replaced. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {boolean} [request.ignoreWarnings] - * If true, ignore safety checks when updating the app profile. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const appProfile = {}; - * const updateMask = {}; - * const request = { - * appProfile: appProfile, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the promise pattern. - * client.updateAppProfile(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const appProfile = {}; - * const updateMask = {}; - * const request = { - * appProfile: appProfile, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.updateAppProfile(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const appProfile = {}; - * const updateMask = {}; - * const request = { - * appProfile: appProfile, - * updateMask: updateMask, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.updateAppProfile(request); - * - * const [response] = await operation.promise(); - */ - updateAppProfile(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'app_profile.name': request.appProfile.name, - }); - - return this._innerApiCalls.updateAppProfile(request, options, callback); - } - - /** - * 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 - * If true, ignore safety checks when deleting the app profile. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - * const ignoreWarnings = false; - * const request = { - * name: formattedName, - * ignoreWarnings: ignoreWarnings, - * }; - * client.deleteAppProfile(request).catch(err => { - * console.error(err); - * }); - */ - deleteAppProfile(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteAppProfile(request, options, callback); - } - - /** - * 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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.getIamPolicy(request, options, callback); - } - - /** - * 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 {Object} 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. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableInstanceAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified app_profile resource name string. - * - * @param {String} project - * @param {String} instance - * @param {String} appProfile - * @returns {String} - */ - appProfilePath(project, instance, appProfile) { - return this._pathTemplates.appProfilePathTemplate.render({ - project: project, - instance: instance, - app_profile: appProfile, - }); - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {String} project - * @param {String} instance - * @param {String} cluster - * @returns {String} - */ - clusterPath(project, instance, cluster) { - return this._pathTemplates.clusterPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - }); - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {String} project - * @param {String} instance - * @returns {String} - */ - instancePath(project, instance) { - return this._pathTemplates.instancePathTemplate.render({ - project: project, - instance: instance, - }); - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {String} project - * @param {String} location - * @returns {String} - */ - locationPath(project, location) { - return this._pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the appProfileName from a app_profile resource. - * - * @param {String} appProfileName - * A fully-qualified path representing a app_profile resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromAppProfileName(appProfileName) { - return this._pathTemplates.appProfilePathTemplate.match(appProfileName) - .project; - } - - /** - * Parse the appProfileName from a app_profile resource. - * - * @param {String} appProfileName - * A fully-qualified path representing a app_profile resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromAppProfileName(appProfileName) { - return this._pathTemplates.appProfilePathTemplate.match(appProfileName) - .instance; - } - - /** - * Parse the appProfileName from a app_profile resource. - * - * @param {String} appProfileName - * A fully-qualified path representing a app_profile resources. - * @returns {String} - A string representing the app_profile. - */ - matchAppProfileFromAppProfileName(appProfileName) { - return this._pathTemplates.appProfilePathTemplate.match(appProfileName) - .app_profile; - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).instance; - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the cluster. - */ - matchClusterFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName) - .instance; - } - - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = BigtableInstanceAdminClient; diff --git a/src/v2/bigtable_instance_admin_client.ts b/src/v2/bigtable_instance_admin_client.ts new file mode 100644 index 000000000..588ed99a9 --- /dev/null +++ b/src/v2/bigtable_instance_admin_client.ts @@ -0,0 +1,2315 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + bigtableInstanceAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigtableInstanceAdminClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof BigtableInstanceAdminClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof BigtableInstanceAdminClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + appProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + 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' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const 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 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; + + 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) + ), + updateAppProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAppProfileResponse.decode.bind(updateAppProfileResponse), + updateAppProfileMetadata.decode.bind(updateAppProfileMetadata) + ), + }; + + // 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 = {}; + } + + /** + * 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' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.bigtable.admin.v2.BigtableInstanceAdmin, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigtableInstanceAdminStubMethods = [ + 'createInstance', + 'getInstance', + 'listInstances', + 'updateInstance', + 'partialUpdateInstance', + 'deleteInstance', + 'createCluster', + 'getCluster', + 'listClusters', + 'updateCluster', + 'deleteCluster', + 'createAppProfile', + 'getAppProfile', + 'listAppProfiles', + 'updateAppProfile', + 'deleteAppProfile', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + + for (const methodName of bigtableInstanceAdminStubMethods) { + const innerCallPromise = this.bigtableInstanceAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.bigtableInstanceAdminStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigtableadmin.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getInstance( + request: protosTypes.google.bigtable.admin.v2.IGetInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protosTypes.google.bigtable.admin.v2.IGetInstanceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Instance]{@link google.bigtable.admin.v2.Instance}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getInstance( + request: protosTypes.google.bigtable.admin.v2.IGetInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.getInstance(request, options, callback); + } + listInstances( + request: protosTypes.google.bigtable.admin.v2.IListInstancesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IListInstancesResponse, + protosTypes.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined + ] + >; + listInstances( + request: protosTypes.google.bigtable.admin.v2.IListInstancesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IListInstancesResponse, + protosTypes.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [ListInstancesResponse]{@link google.bigtable.admin.v2.ListInstancesResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listInstances( + request: protosTypes.google.bigtable.admin.v2.IListInstancesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IListInstancesResponse, + | protosTypes.google.bigtable.admin.v2.IListInstancesRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IListInstancesResponse, + protosTypes.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IListInstancesResponse, + protosTypes.google.bigtable.admin.v2.IListInstancesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.listInstances(request, options, callback); + } + updateInstance( + request: protosTypes.google.bigtable.admin.v2.IInstance, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined + ] + >; + updateInstance( + request: protosTypes.google.bigtable.admin.v2.IInstance, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined + > + ): void; + /** + * 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 {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 [Instance]{@link google.bigtable.admin.v2.Instance}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateInstance( + request: protosTypes.google.bigtable.admin.v2.IInstance, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IInstance | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.updateInstance(request, options, callback); + } + deleteInstance( + request: protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteInstance( + request: protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.deleteInstance(request, options, callback); + } + getCluster( + request: protosTypes.google.bigtable.admin.v2.IGetClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined + ] + >; + getCluster( + request: protosTypes.google.bigtable.admin.v2.IGetClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Cluster]{@link google.bigtable.admin.v2.Cluster}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getCluster( + request: protosTypes.google.bigtable.admin.v2.IGetClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IGetClusterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.getCluster(request, options, callback); + } + listClusters( + request: protosTypes.google.bigtable.admin.v2.IListClustersRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IListClustersResponse, + protosTypes.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined + ] + >; + listClusters( + request: protosTypes.google.bigtable.admin.v2.IListClustersRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IListClustersResponse, + protosTypes.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [ListClustersResponse]{@link google.bigtable.admin.v2.ListClustersResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listClusters( + request: protosTypes.google.bigtable.admin.v2.IListClustersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IListClustersResponse, + protosTypes.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IListClustersResponse, + protosTypes.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IListClustersResponse, + protosTypes.google.bigtable.admin.v2.IListClustersRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.listClusters(request, options, callback); + } + deleteCluster( + request: protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined + ] + >; + deleteCluster( + request: protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteCluster( + request: protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.deleteCluster(request, options, callback); + } + createAppProfile( + request: protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined + ] + >; + createAppProfile( + request: protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createAppProfile( + request: protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + | protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createAppProfile(request, options, callback); + } + getAppProfile( + request: protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined + ] + >; + getAppProfile( + request: protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getAppProfile( + request: protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + | protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.getAppProfile(request, options, callback); + } + deleteAppProfile( + request: protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined + ] + >; + deleteAppProfile( + request: protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteAppProfile( + request: protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.deleteAppProfile(request, options, callback); + } + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 {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 [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Sets the access control policy on an instance resource. Replaces any + * existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @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 [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns permissions that the caller has on the specified instance resource. + * + * @param {Object} request + * The request object that will be sent. + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + + createInstance( + request: protosTypes.google.bigtable.admin.v2.ICreateInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protosTypes.google.bigtable.admin.v2.ICreateInstanceRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Create an instance within a project. + * + * @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. + * Currently, at most four clusters can be specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createInstance( + request: protosTypes.google.bigtable.admin.v2.ICreateInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.ICreateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createInstance(request, options, callback); + } + partialUpdateInstance( + request: protosTypes.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + partialUpdateInstance( + request: protosTypes.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + partialUpdateInstance( + request: protosTypes.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IInstance, + protosTypes.google.bigtable.admin.v2.IUpdateInstanceMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); + this.initialize(); + return this._innerApiCalls.partialUpdateInstance( + request, + options, + callback + ); + } + createCluster( + request: protosTypes.google.bigtable.admin.v2.ICreateClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCluster( + request: protosTypes.google.bigtable.admin.v2.ICreateClusterRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Creates a cluster 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 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createCluster( + request: protosTypes.google.bigtable.admin.v2.ICreateClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.ICreateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createCluster(request, options, callback); + } + updateCluster( + request: protosTypes.google.bigtable.admin.v2.ICluster, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCluster( + request: protosTypes.google.bigtable.admin.v2.ICluster, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Updates a cluster within an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateCluster( + request: protosTypes.google.bigtable.admin.v2.ICluster, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ICluster, + protosTypes.google.bigtable.admin.v2.IUpdateClusterMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.updateCluster(request, options, callback); + } + updateAppProfile( + request: protosTypes.google.bigtable.admin.v2.IUpdateAppProfileRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateAppProfile( + request: protosTypes.google.bigtable.admin.v2.IUpdateAppProfileRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateAppProfile( + request: protosTypes.google.bigtable.admin.v2.IUpdateAppProfileRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.IAppProfile, + protosTypes.google.bigtable.admin.v2.IUpdateAppProfileMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'app_profile.name': request.appProfile!.name || '', + }); + this.initialize(); + return this._innerApiCalls.updateAppProfile(request, options, callback); + } + listAppProfiles( + request: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile[], + protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protosTypes.google.bigtable.admin.v2.IListAppProfilesResponse + ] + >; + listAppProfiles( + request: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile[], + protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protosTypes.google.bigtable.admin.v2.IListAppProfilesResponse + > + ): void; + /** + * 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 [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [AppProfile]{@link google.bigtable.admin.v2.AppProfile} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListAppProfilesRequest]{@link google.bigtable.admin.v2.ListAppProfilesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListAppProfilesResponse]{@link google.bigtable.admin.v2.ListAppProfilesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAppProfiles( + request: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile[], + protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protosTypes.google.bigtable.admin.v2.IListAppProfilesResponse + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IAppProfile[], + protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protosTypes.google.bigtable.admin.v2.IListAppProfilesResponse + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IAppProfile[], + protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest | null, + protosTypes.google.bigtable.admin.v2.IListAppProfilesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.listAppProfiles(request, options, callback); + } + + /** + * Equivalent to {@link listAppProfiles}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAppProfiles} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The 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 [AppProfile]{@link google.bigtable.admin.v2.AppProfile} on 'data' event. + */ + listAppProfilesStream( + request?: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this._descriptors.page.listAppProfiles.createStream( + this._innerApiCalls.listAppProfiles as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- 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, + 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 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, + instance, + 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 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, + 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 project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this._pathTemplates.projectPathTemplate.render({ + 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 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, + instance, + cluster, + 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, + instance, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.bigtableInstanceAdminStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v2/bigtable_instance_admin_client_config.json b/src/v2/bigtable_instance_admin_client_config.json index 0b75f1819..2f6b84535 100644 --- a/src/v2/bigtable_instance_admin_client_config.json +++ b/src/v2/bigtable_instance_admin_client_config.json @@ -2,136 +2,127 @@ "interfaces": { "google.bigtable.admin.v2.BigtableInstanceAdmin": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { - "idempotent_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.0, + "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.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 }, - "non_idempotent_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 1.0, - "max_retry_delay_millis": 0, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "non_idempotent_heavy_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 1.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 + "total_timeout_millis": 600000 } }, "methods": { "CreateInstance": { "timeout_millis": 300000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_heavy_params" + "retry_params_name": "default" }, "GetInstance": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "ListInstances": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "UpdateInstance": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "PartialUpdateInstance": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "DeleteInstance": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "CreateCluster": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "GetCluster": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "ListClusters": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "UpdateCluster": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "DeleteCluster": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "CreateAppProfile": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "GetAppProfile": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "ListAppProfiles": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "UpdateAppProfile": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "DeleteAppProfile": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "GetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "SetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "TestIamPermissions": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" } } } diff --git a/src/v2/bigtable_instance_admin_proto_list.json b/src/v2/bigtable_instance_admin_proto_list.json index 51eaa619c..1f7e1af50 100644 --- a/src/v2/bigtable_instance_admin_proto_list.json +++ b/src/v2/bigtable_instance_admin_proto_list.json @@ -1,3 +1,7 @@ [ - "../../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto" + "../../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" ] diff --git a/src/v2/bigtable_proto_list.json b/src/v2/bigtable_proto_list.json index a118ea1f1..f3b34ab8b 100644 --- a/src/v2/bigtable_proto_list.json +++ b/src/v2/bigtable_proto_list.json @@ -1,3 +1,4 @@ [ - "../../protos/google/bigtable/v2/bigtable.proto" + "../../protos/google/bigtable/v2/bigtable.proto", + "../../protos/google/bigtable/v2/data.proto" ] diff --git a/src/v2/bigtable_table_admin_client.js b/src/v2/bigtable_table_admin_client.js deleted file mode 100644 index 09ce4c8c3..000000000 --- a/src/v2/bigtable_table_admin_client.js +++ /dev/null @@ -1,1925 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const gapicConfig = require('./bigtable_table_admin_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -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 - */ -class BigtableTableAdminClient { - /** - * Construct an instance of BigtableTableAdminClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - clusterPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}' - ), - instancePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - snapshotPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}' - ), - tablePathTemplate: new 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 gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'tables' - ), - listSnapshots: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'snapshots' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const createTableFromSnapshotResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Table' - ); - const createTableFromSnapshotMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.CreateTableFromSnapshotMetadata' - ); - const snapshotTableResponse = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.Snapshot' - ); - const snapshotTableMetadata = protoFilesRoot.lookup( - 'google.bigtable.admin.v2.SnapshotTableMetadata' - ); - - this._descriptors.longrunning = { - createTableFromSnapshot: new gaxModule.LongrunningDescriptor( - this.operationsClient, - createTableFromSnapshotResponse.decode.bind( - createTableFromSnapshotResponse - ), - createTableFromSnapshotMetadata.decode.bind( - createTableFromSnapshotMetadata - ) - ), - snapshotTable: new gaxModule.LongrunningDescriptor( - this.operationsClient, - snapshotTableResponse.decode.bind(snapshotTableResponse), - snapshotTableMetadata.decode.bind(snapshotTableMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.bigtable.admin.v2.BigtableTableAdmin', - gapicConfig, - opts.clientConfig, - {'x-goog-api-client': clientHeader.join(' ')} - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this._innerApiCalls = {}; - - // Put together the "service stub" for - // google.bigtable.admin.v2.BigtableTableAdmin. - const bigtableTableAdminStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.bigtable.admin.v2.BigtableTableAdmin') - : protos.google.bigtable.admin.v2.BigtableTableAdmin, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const bigtableTableAdminStubMethods = [ - 'createTable', - 'createTableFromSnapshot', - 'listTables', - 'getTable', - 'deleteTable', - 'modifyColumnFamilies', - 'dropRowRange', - 'generateConsistencyToken', - 'checkConsistency', - 'getIamPolicy', - 'setIamPolicy', - 'testIamPermissions', - 'snapshotTable', - 'getSnapshot', - 'listSnapshots', - 'deleteSnapshot', - ]; - for (const methodName of bigtableTableAdminStubMethods) { - const innerCallPromise = bigtableTableAdminStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.cluster', - 'https://www.googleapis.com/auth/bigtable.admin.instance', - 'https://www.googleapis.com/auth/bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', - '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', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * 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 {Object} request.table - * Required. The Table to create. - * - * This object should have the same structure as [Table]{@link google.bigtable.admin.v2.Table} - * @param {Object[]} [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"}.` - * - * This object should have the same structure as [Split]{@link google.bigtable.admin.v2.Split} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const tableId = ''; - * const table = {}; - * const request = { - * parent: formattedParent, - * tableId: tableId, - * table: table, - * }; - * client.createTable(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createTable(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createTable(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const tableId = ''; - * const sourceSnapshot = ''; - * const request = { - * parent: formattedParent, - * tableId: tableId, - * sourceSnapshot: sourceSnapshot, - * }; - * - * // Handle the operation using the promise pattern. - * client.createTableFromSnapshot(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const tableId = ''; - * const sourceSnapshot = ''; - * const request = { - * parent: formattedParent, - * tableId: tableId, - * sourceSnapshot: sourceSnapshot, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.createTableFromSnapshot(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * const tableId = ''; - * const sourceSnapshot = ''; - * const request = { - * parent: formattedParent, - * tableId: tableId, - * sourceSnapshot: sourceSnapshot, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.createTableFromSnapshot(request); - * - * const [response] = await operation.promise(); - */ - createTableFromSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createTableFromSnapshot( - request, - options, - callback - ); - } - - /** - * 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 {number} [request.view] - * The view to be applied to the returned tables' fields. - * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * - * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} - * @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 {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Table]{@link google.bigtable.admin.v2.Table}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListTablesResponse]{@link google.bigtable.admin.v2.ListTablesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Table]{@link google.bigtable.admin.v2.Table}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Table]{@link google.bigtable.admin.v2.Table} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListTablesResponse]{@link google.bigtable.admin.v2.ListTablesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * - * client.listTables({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listTables(nextRequest, options).then(callback); - * } - * } - * client.listTables({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listTables(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listTables(request, options, callback); - } - - /** - * Equivalent to {@link listTables}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listTables} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance for which tables should be listed. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param {number} [request.view] - * The view to be applied to the returned tables' fields. - * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * - * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} - * @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 {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Table]{@link google.bigtable.admin.v2.Table} on 'data' event. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * client.listTablesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listTablesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listTables.createStream( - this._innerApiCalls.listTables, - request, - options - ); - } - - /** - * 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 {number} [request.view] - * The view to be applied to the returned table's fields. - * Defaults to `SCHEMA_VIEW` if unspecified. - * - * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.getTable({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getTable(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getTable(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.deleteTable({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteTable(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteTable(request, options, callback); - } - - /** - * 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 {Object[]} 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). - * - * This object should have the same structure as [Modification]{@link google.bigtable.admin.v2.Modification} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const modifications = []; - * const request = { - * name: formattedName, - * modifications: modifications, - * }; - * client.modifyColumnFamilies(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - modifyColumnFamilies(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.modifyColumnFamilies(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.dropRowRange({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - dropRowRange(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.dropRowRange(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [GenerateConsistencyTokenResponse]{@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [GenerateConsistencyTokenResponse]{@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.generateConsistencyToken({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - generateConsistencyToken(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.generateConsistencyToken( - request, - options, - callback - ); - } - - /** - * 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 {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [CheckConsistencyResponse]{@link google.bigtable.admin.v2.CheckConsistencyResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CheckConsistencyResponse]{@link google.bigtable.admin.v2.CheckConsistencyResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const consistencyToken = ''; - * const request = { - * name: formattedName, - * consistencyToken: consistencyToken, - * }; - * client.checkConsistency(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - checkConsistency(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.checkConsistency(request, options, callback); - } - - /** - * Gets the access control policy for a 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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.getIamPolicy(request, options, callback); - } - - /** - * Sets the access control policy on a Table or Backup 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 {Object} 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. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * Returns permissions that the caller has on the specified table 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - /** - * 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 - * 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 - * 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 - * 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`. - * @param {string} request.description - * Description of the snapshot. - * @param {Object} [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. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const cluster = ''; - * const snapshotId = ''; - * const description = ''; - * const request = { - * name: formattedName, - * cluster: cluster, - * snapshotId: snapshotId, - * description: description, - * }; - * - * // Handle the operation using the promise pattern. - * client.snapshotTable(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const cluster = ''; - * const snapshotId = ''; - * const description = ''; - * const request = { - * name: formattedName, - * cluster: cluster, - * snapshotId: snapshotId, - * description: description, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.snapshotTable(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * const cluster = ''; - * const snapshotId = ''; - * const description = ''; - * const request = { - * name: formattedName, - * cluster: cluster, - * snapshotId: snapshotId, - * description: description, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.snapshotTable(request); - * - * const [response] = await operation.promise(); - */ - snapshotTable(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.snapshotTable(request, options, callback); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - * client.getSnapshot({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getSnapshot(request, options, callback); - } - - /** - * 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 resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListSnapshotsResponse]{@link google.bigtable.admin.v2.ListSnapshotsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Snapshot]{@link google.bigtable.admin.v2.Snapshot} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListSnapshotsResponse]{@link google.bigtable.admin.v2.ListSnapshotsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * - * client.listSnapshots({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listSnapshots(nextRequest, options).then(callback); - * } - * } - * client.listSnapshots({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listSnapshots(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listSnapshots(request, options, callback); - } - - /** - * Equivalent to {@link listSnapshots}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSnapshots} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The 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 resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot} on 'data' event. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * client.listSnapshotsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listSnapshotsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listSnapshots.createStream( - this._innerApiCalls.listSnapshots, - request, - options - ); - } - - /** - * 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] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const admin = require('admin.v2'); - * - * const client = new admin.v2.BigtableTableAdminClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - * client.deleteSnapshot({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteSnapshot(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {String} project - * @param {String} instance - * @param {String} cluster - * @returns {String} - */ - clusterPath(project, instance, cluster) { - return this._pathTemplates.clusterPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - }); - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {String} project - * @param {String} instance - * @returns {String} - */ - instancePath(project, instance) { - return this._pathTemplates.instancePathTemplate.render({ - project: project, - instance: instance, - }); - } - - /** - * Return a fully-qualified snapshot resource name string. - * - * @param {String} project - * @param {String} instance - * @param {String} cluster - * @param {String} snapshot - * @returns {String} - */ - snapshotPath(project, instance, cluster, snapshot) { - return this._pathTemplates.snapshotPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - snapshot: snapshot, - }); - } - - /** - * Return a fully-qualified table resource name string. - * - * @param {String} project - * @param {String} instance - * @param {String} table - * @returns {String} - */ - tablePath(project, instance, table) { - return this._pathTemplates.tablePathTemplate.render({ - project: project, - instance: instance, - table: table, - }); - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).instance; - } - - /** - * Parse the clusterName from a cluster resource. - * - * @param {String} clusterName - * A fully-qualified path representing a cluster resources. - * @returns {String} - A string representing the cluster. - */ - matchClusterFromClusterName(clusterName) { - return this._pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName) - .instance; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName) - .instance; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the cluster. - */ - matchClusterFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName).cluster; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName) - .snapshot; - } - - /** - * Parse the tableName from a table resource. - * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromTableName(tableName) { - return this._pathTemplates.tablePathTemplate.match(tableName).project; - } - - /** - * Parse the tableName from a table resource. - * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromTableName(tableName) { - return this._pathTemplates.tablePathTemplate.match(tableName).instance; - } - - /** - * Parse the tableName from a table resource. - * - * @param {String} tableName - * A fully-qualified path representing a table resources. - * @returns {String} - A string representing the table. - */ - matchTableFromTableName(tableName) { - return this._pathTemplates.tablePathTemplate.match(tableName).table; - } -} - -module.exports = BigtableTableAdminClient; diff --git a/src/v2/bigtable_table_admin_client.ts b/src/v2/bigtable_table_admin_client.ts new file mode 100644 index 000000000..c55bb969f --- /dev/null +++ b/src/v2/bigtable_table_admin_client.ts @@ -0,0 +1,2160 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + bigtableTableAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigtableTableAdminClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof BigtableTableAdminClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof BigtableTableAdminClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + appProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/clusters/{cluster}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}' + ), + 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' + ), + listSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const 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 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; + + this._descriptors.longrunning = { + createTableFromSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTableFromSnapshotResponse.decode.bind( + createTableFromSnapshotResponse + ), + createTableFromSnapshotMetadata.decode.bind( + createTableFromSnapshotMetadata + ) + ), + snapshotTable: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + snapshotTableResponse.decode.bind(snapshotTableResponse), + snapshotTableMetadata.decode.bind(snapshotTableMetadata) + ), + }; + + // 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 = {}; + } + + /** + * 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' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.bigtable.admin.v2.BigtableTableAdmin, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigtableTableAdminStubMethods = [ + 'createTable', + 'createTableFromSnapshot', + 'listTables', + 'getTable', + 'deleteTable', + 'modifyColumnFamilies', + 'dropRowRange', + 'generateConsistencyToken', + 'checkConsistency', + 'snapshotTable', + 'getSnapshot', + 'listSnapshots', + 'deleteSnapshot', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + + for (const methodName of bigtableTableAdminStubMethods) { + const innerCallPromise = this.bigtableTableAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.bigtableTableAdminStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'bigtableadmin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigtableadmin.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createTable( + request: protosTypes.google.bigtable.admin.v2.ICreateTableRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined + ] + >; + createTable( + request: protosTypes.google.bigtable.admin.v2.ICreateTableRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Table]{@link google.bigtable.admin.v2.Table}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createTable( + request: protosTypes.google.bigtable.admin.v2.ICreateTableRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createTable(request, options, callback); + } + getTable( + request: protosTypes.google.bigtable.admin.v2.IGetTableRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined + ] + >; + getTable( + request: protosTypes.google.bigtable.admin.v2.IGetTableRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Table]{@link google.bigtable.admin.v2.Table}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getTable( + request: protosTypes.google.bigtable.admin.v2.IGetTableRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.IGetTableRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.getTable(request, options, callback); + } + deleteTable( + request: protosTypes.google.bigtable.admin.v2.IDeleteTableRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined + ] + >; + deleteTable( + request: protosTypes.google.bigtable.admin.v2.IDeleteTableRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteTable( + request: protosTypes.google.bigtable.admin.v2.IDeleteTableRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteTableRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.deleteTable(request, options, callback); + } + modifyColumnFamilies( + request: protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + ( + | protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined + ), + {} | undefined + ] + >; + modifyColumnFamilies( + request: protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + | protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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 {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 [Table]{@link google.bigtable.admin.v2.Table}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + modifyColumnFamilies( + request: protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ITable, + | protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ITable, + | protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable, + ( + | protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.modifyColumnFamilies(request, options, callback); + } + dropRowRange( + request: protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined + ] + >; + dropRowRange( + request: protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + dropRowRange( + request: protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.dropRowRange(request, options, callback); + } + generateConsistencyToken( + request: protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + ( + | protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined + ), + {} | undefined + ] + >; + generateConsistencyToken( + request: protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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 [GenerateConsistencyTokenResponse]{@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + generateConsistencyToken( + request: protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + | protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, + ( + | protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.generateConsistencyToken( + request, + options, + callback + ); + } + checkConsistency( + request: protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ICheckConsistencyResponse, + protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined + ] + >; + checkConsistency( + request: protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ICheckConsistencyResponse, + protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 {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 [CheckConsistencyResponse]{@link google.bigtable.admin.v2.CheckConsistencyResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + checkConsistency( + request: protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ICheckConsistencyResponse, + | protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ICheckConsistencyResponse, + protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ICheckConsistencyResponse, + protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.checkConsistency(request, options, callback); + } + getSnapshot( + request: protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined + ] + >; + getSnapshot( + request: protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getSnapshot( + request: protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.getSnapshot(request, options, callback); + } + deleteSnapshot( + request: protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + >; + deleteSnapshot( + request: protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined + > + ): void; + /** + * 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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteSnapshot( + request: protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.deleteSnapshot(request, options, callback); + } + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets the access control policy for a 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 {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 [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Sets the access control policy on a Table or Backup resource. + * Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @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 [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns permissions that the caller has on the specified table resource. + * + * @param {Object} request + * The request object that will be sent. + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + + createTableFromSnapshot( + request: protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTableFromSnapshot( + request: protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createTableFromSnapshot( + request: protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ITable, + protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.createTableFromSnapshot( + request, + options, + callback + ); + } + snapshotTable( + request: protosTypes.google.bigtable.admin.v2.ISnapshotTableRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + snapshotTable( + request: protosTypes.google.bigtable.admin.v2.ISnapshotTableRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 + * 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 + * 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 + * The ID by which the new snapshot should be referred to within the parent + * cluster, e.g., `mysnapshot` of the form: `{@link -_.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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + snapshotTable( + request: protosTypes.google.bigtable.admin.v2.ISnapshotTableRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.bigtable.admin.v2.ISnapshot, + protosTypes.google.bigtable.admin.v2.ISnapshotTableMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this._innerApiCalls.snapshotTable(request, options, callback); + } + listTables( + request: protosTypes.google.bigtable.admin.v2.IListTablesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable[], + protosTypes.google.bigtable.admin.v2.IListTablesRequest | null, + protosTypes.google.bigtable.admin.v2.IListTablesResponse + ] + >; + listTables( + request: protosTypes.google.bigtable.admin.v2.IListTablesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ITable[], + protosTypes.google.bigtable.admin.v2.IListTablesRequest | null, + protosTypes.google.bigtable.admin.v2.IListTablesResponse + > + ): void; + /** + * 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. + * Only 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 [Table]{@link google.bigtable.admin.v2.Table}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Table]{@link google.bigtable.admin.v2.Table} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListTablesRequest]{@link google.bigtable.admin.v2.ListTablesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListTablesResponse]{@link google.bigtable.admin.v2.ListTablesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listTables( + request: protosTypes.google.bigtable.admin.v2.IListTablesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ITable[], + protosTypes.google.bigtable.admin.v2.IListTablesRequest | null, + protosTypes.google.bigtable.admin.v2.IListTablesResponse + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ITable[], + protosTypes.google.bigtable.admin.v2.IListTablesRequest | null, + protosTypes.google.bigtable.admin.v2.IListTablesResponse + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ITable[], + protosTypes.google.bigtable.admin.v2.IListTablesRequest | null, + protosTypes.google.bigtable.admin.v2.IListTablesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.listTables(request, options, callback); + } + + /** + * Equivalent to {@link listTables}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTables} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The 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. + * Only 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 [Table]{@link google.bigtable.admin.v2.Table} on 'data' event. + */ + listTablesStream( + request?: protosTypes.google.bigtable.admin.v2.IListTablesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this._descriptors.page.listTables.createStream( + this._innerApiCalls.listTables as gax.GaxCall, + request, + callSettings + ); + } + listSnapshots( + request: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ISnapshot[], + protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protosTypes.google.bigtable.admin.v2.IListSnapshotsResponse + ] + >; + listSnapshots( + request: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot[], + protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protosTypes.google.bigtable.admin.v2.IListSnapshotsResponse + > + ): void; + /** + * 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 [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Snapshot]{@link google.bigtable.admin.v2.Snapshot} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSnapshotsRequest]{@link google.bigtable.admin.v2.ListSnapshotsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSnapshotsResponse]{@link google.bigtable.admin.v2.ListSnapshotsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listSnapshots( + request: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot[], + protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protosTypes.google.bigtable.admin.v2.IListSnapshotsResponse + >, + callback?: Callback< + protosTypes.google.bigtable.admin.v2.ISnapshot[], + protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protosTypes.google.bigtable.admin.v2.IListSnapshotsResponse + > + ): Promise< + [ + protosTypes.google.bigtable.admin.v2.ISnapshot[], + protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest | null, + protosTypes.google.bigtable.admin.v2.IListSnapshotsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this._innerApiCalls.listSnapshots(request, options, callback); + } + + /** + * Equivalent to {@link listSnapshots}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSnapshots} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The 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 [Snapshot]{@link google.bigtable.admin.v2.Snapshot} on 'data' event. + */ + listSnapshotsStream( + request?: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this._descriptors.page.listSnapshots.createStream( + this._innerApiCalls.listSnapshots as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- 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, + 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 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, + instance, + 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 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, + 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 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, + instance, + cluster, + 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, + instance, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.bigtableTableAdminStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v2/bigtable_table_admin_client_config.json b/src/v2/bigtable_table_admin_client_config.json index b501a0e0a..8109677f3 100644 --- a/src/v2/bigtable_table_admin_client_config.json +++ b/src/v2/bigtable_table_admin_client_config.json @@ -2,130 +2,112 @@ "interfaces": { "google.bigtable.admin.v2.BigtableTableAdmin": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { - "idempotent_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.0, + "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.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 }, - "non_idempotent_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 1.0, - "max_retry_delay_millis": 0, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "non_idempotent_heavy_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 1.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "drop_row_range_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 1.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 3600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 3600000, - "total_timeout_millis": 3600000 + "total_timeout_millis": 600000 } }, "methods": { "CreateTable": { - "timeout_millis": 130000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_heavy_params" + "retry_params_name": "default" }, "CreateTableFromSnapshot": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "ListTables": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "GetTable": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "DeleteTable": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, "ModifyColumnFamilies": { "timeout_millis": 300000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_heavy_params" + "retry_params_name": "default" }, "DropRowRange": { - "timeout_millis": 900000, + "timeout_millis": 3600000, "retry_codes_name": "non_idempotent", - "retry_params_name": "drop_row_range_params" + "retry_params_name": "default" }, "GenerateConsistencyToken": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "CheckConsistency": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, - "GetIamPolicy": { + "SnapshotTable": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" }, - "SetIamPolicy": { + "GetSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, - "TestIamPermissions": { + "ListSnapshots": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, - "SnapshotTable": { + "DeleteSnapshot": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_params_name": "default" }, - "GetSnapshot": { + "GetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, - "ListSnapshots": { + "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "idempotent_params" + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" }, - "DeleteSnapshot": { + "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "non_idempotent_params" + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" } } } diff --git a/src/v2/bigtable_table_admin_proto_list.json b/src/v2/bigtable_table_admin_proto_list.json index fd7c559d9..1f7e1af50 100644 --- a/src/v2/bigtable_table_admin_proto_list.json +++ b/src/v2/bigtable_table_admin_proto_list.json @@ -1,3 +1,7 @@ [ - "../../protos/google/bigtable/admin/v2/bigtable_table_admin.proto" + "../../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" ] diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js deleted file mode 100644 index f5e71fa9b..000000000 --- a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for BigtableInstanceAdmin.CreateInstance. - * - * @property {string} parent - * Required. The unique name of the project in which to create the new instance. - * Values are of the form `projects/{project}`. - * - * @property {string} 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`. - * - * @property {Object} instance - * Required. The instance to create. - * Fields marked `OutputOnly` must be left blank. - * - * This object should have the same structure as [Instance]{@link google.bigtable.admin.v2.Instance} - * - * @property {Object.} 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. - * Currently, at most four clusters can be specified. - * - * @typedef CreateInstanceRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const CreateInstanceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.GetInstance. - * - * @property {string} name - * Required. The unique name of the requested instance. Values are of the form - * `projects/{project}/instances/{instance}`. - * - * @typedef GetInstanceRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GetInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const GetInstanceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.ListInstances. - * - * @property {string} parent - * Required. The unique name of the project for which a list of instances is requested. - * Values are of the form `projects/{project}`. - * - * @property {string} pageToken - * DEPRECATED: This field is unused and ignored. - * - * @typedef ListInstancesRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListInstancesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListInstancesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for BigtableInstanceAdmin.ListInstances. - * - * @property {Object[]} instances - * The list of requested instances. - * - * This object should have the same structure as [Instance]{@link google.bigtable.admin.v2.Instance} - * - * @property {string[]} failedLocations - * 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/` - * - * @property {string} nextPageToken - * DEPRECATED: This field is unused and ignored. - * - * @typedef ListInstancesResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListInstancesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListInstancesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.PartialUpdateInstance. - * - * @property {Object} instance - * Required. The Instance which will (partially) replace the current value. - * - * This object should have the same structure as [Instance]{@link google.bigtable.admin.v2.Instance} - * - * @property {Object} updateMask - * Required. The subset of Instance fields which should be replaced. - * Must be explicitly set. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef PartialUpdateInstanceRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.PartialUpdateInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const PartialUpdateInstanceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.DeleteInstance. - * - * @property {string} name - * Required. The unique name of the instance to be deleted. - * Values are of the form `projects/{project}/instances/{instance}`. - * - * @typedef DeleteInstanceRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DeleteInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const DeleteInstanceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.CreateCluster. - * - * @property {string} parent - * Required. The unique name of the instance in which to create the new cluster. - * Values are of the form - * `projects/{project}/instances/{instance}`. - * - * @property {string} 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`. - * - * @property {Object} cluster - * Required. The cluster to be created. - * Fields marked `OutputOnly` must be left blank. - * - * This object should have the same structure as [Cluster]{@link google.bigtable.admin.v2.Cluster} - * - * @typedef CreateClusterRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const CreateClusterRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.GetCluster. - * - * @property {string} name - * Required. The unique name of the requested cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * - * @typedef GetClusterRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GetClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const GetClusterRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.ListClusters. - * - * @property {string} 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/-`. - * - * @property {string} pageToken - * DEPRECATED: This field is unused and ignored. - * - * @typedef ListClustersRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListClustersRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListClustersRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for BigtableInstanceAdmin.ListClusters. - * - * @property {Object[]} clusters - * The list of requested clusters. - * - * This object should have the same structure as [Cluster]{@link google.bigtable.admin.v2.Cluster} - * - * @property {string[]} failedLocations - * 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/` - * - * @property {string} nextPageToken - * DEPRECATED: This field is unused and ignored. - * - * @typedef ListClustersResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListClustersResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListClustersResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.DeleteCluster. - * - * @property {string} name - * Required. The unique name of the cluster to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * - * @typedef DeleteClusterRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DeleteClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const DeleteClusterRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The metadata for the Operation returned by CreateInstance. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this CreateInstance operation. - * - * This object should have the same structure as [CreateInstanceRequest]{@link google.bigtable.admin.v2.CreateInstanceRequest} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef CreateInstanceMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateInstanceMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const CreateInstanceMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The metadata for the Operation returned by UpdateInstance. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this UpdateInstance operation. - * - * This object should have the same structure as [PartialUpdateInstanceRequest]{@link google.bigtable.admin.v2.PartialUpdateInstanceRequest} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef UpdateInstanceMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.UpdateInstanceMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const UpdateInstanceMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The metadata for the Operation returned by CreateCluster. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this CreateCluster operation. - * - * This object should have the same structure as [CreateClusterRequest]{@link google.bigtable.admin.v2.CreateClusterRequest} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef CreateClusterMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateClusterMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const CreateClusterMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The metadata for the Operation returned by UpdateCluster. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this UpdateCluster operation. - * - * This object should have the same structure as [Cluster]{@link google.bigtable.admin.v2.Cluster} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef UpdateClusterMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.UpdateClusterMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const UpdateClusterMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.CreateAppProfile. - * - * @property {string} 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}`. - * - * @property {string} 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`. - * - * @property {Object} appProfile - * Required. The app profile to be created. - * Fields marked `OutputOnly` will be ignored. - * - * This object should have the same structure as [AppProfile]{@link google.bigtable.admin.v2.AppProfile} - * - * @property {boolean} ignoreWarnings - * If true, ignore safety checks when creating the app profile. - * - * @typedef CreateAppProfileRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const CreateAppProfileRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.GetAppProfile. - * - * @property {string} name - * Required. The unique name of the requested app profile. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * - * @typedef GetAppProfileRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GetAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const GetAppProfileRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.ListAppProfiles. - * - * @property {string} 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/-`. - * - * @property {number} 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. - * - * @property {string} pageToken - * The value of `next_page_token` returned by a previous call. - * - * @typedef ListAppProfilesRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListAppProfilesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListAppProfilesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for BigtableInstanceAdmin.ListAppProfiles. - * - * @property {Object[]} appProfiles - * The list of requested app profiles. - * - * This object should have the same structure as [AppProfile]{@link google.bigtable.admin.v2.AppProfile} - * - * @property {string} nextPageToken - * 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. - * - * @property {string[]} failedLocations - * 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/` - * - * @typedef ListAppProfilesResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListAppProfilesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const ListAppProfilesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.UpdateAppProfile. - * - * @property {Object} appProfile - * Required. The app profile which will (partially) replace the current value. - * - * This object should have the same structure as [AppProfile]{@link google.bigtable.admin.v2.AppProfile} - * - * @property {Object} updateMask - * Required. The subset of app profile fields which should be replaced. - * If unset, all fields will be replaced. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {boolean} ignoreWarnings - * If true, ignore safety checks when updating the app profile. - * - * @typedef UpdateAppProfileRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.UpdateAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const UpdateAppProfileRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableInstanceAdmin.DeleteAppProfile. - * - * @property {string} name - * Required. The unique name of the app profile to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * - * @property {boolean} ignoreWarnings - * If true, ignore safety checks when deleting the app profile. - * - * @typedef DeleteAppProfileRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DeleteAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const DeleteAppProfileRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The metadata for the Operation returned by UpdateAppProfile. - * @typedef UpdateAppProfileMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.UpdateAppProfileMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} - */ -const UpdateAppProfileMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js deleted file mode 100644 index 190a29699..000000000 --- a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js +++ /dev/null @@ -1,561 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.CreateTable - * - * @property {string} parent - * Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * - * @property {string} 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. - * - * @property {Object} table - * Required. The Table to create. - * - * This object should have the same structure as [Table]{@link google.bigtable.admin.v2.Table} - * - * @property {Object[]} 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"}.` - * - * This object should have the same structure as [Split]{@link google.bigtable.admin.v2.Split} - * - * @typedef CreateTableRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const CreateTableRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * An initial split point for a newly created table. - * - * @property {Buffer} key - * Row key to use as an initial tablet boundary. - * - * @typedef Split - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateTableRequest.Split definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ - Split: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for - * 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. - * - * @property {string} parent - * Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * - * @property {string} 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`. - * - * @property {string} 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}`. - * - * @typedef CreateTableFromSnapshotRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateTableFromSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const CreateTableFromSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange - * - * @property {string} 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}`. - * - * @property {Buffer} rowKeyPrefix - * Delete all rows that start with this row key prefix. Prefix cannot be - * zero length. - * - * @property {boolean} deleteAllDataFromTable - * Delete all rows in the table. Setting this to false is a no-op. - * - * @typedef DropRowRangeRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DropRowRangeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const DropRowRangeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.ListTables - * - * @property {string} parent - * Required. The unique name of the instance for which tables should be listed. - * Values are of the form `projects/{project}/instances/{instance}`. - * - * @property {number} view - * The view to be applied to the returned tables' fields. - * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * - * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} - * - * @property {number} 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. - * - * @property {string} pageToken - * The value of `next_page_token` returned by a previous call. - * - * @typedef ListTablesRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListTablesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const ListTablesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for - * google.bigtable.admin.v2.BigtableTableAdmin.ListTables - * - * @property {Object[]} tables - * The tables present in the requested instance. - * - * This object should have the same structure as [Table]{@link google.bigtable.admin.v2.Table} - * - * @property {string} nextPageToken - * 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. - * - * @typedef ListTablesResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListTablesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const ListTablesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.GetTable - * - * @property {string} name - * Required. The unique name of the requested table. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * - * @property {number} view - * The view to be applied to the returned table's fields. - * Defaults to `SCHEMA_VIEW` if unspecified. - * - * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} - * - * @typedef GetTableRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GetTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const GetTableRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable - * - * @property {string} name - * Required. The unique name of the table to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * - * @typedef DeleteTableRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DeleteTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const DeleteTableRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies - * - * @property {string} name - * Required. The unique name of the table whose families should be modified. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * - * @property {Object[]} 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). - * - * This object should have the same structure as [Modification]{@link google.bigtable.admin.v2.Modification} - * - * @typedef ModifyColumnFamiliesRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ModifyColumnFamiliesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const ModifyColumnFamiliesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A create, update, or delete of a particular column family. - * - * @property {string} id - * The ID of the column family to be modified. - * - * @property {Object} create - * Create a new column family with the specified schema, or fail if - * one already exists with the given ID. - * - * This object should have the same structure as [ColumnFamily]{@link google.bigtable.admin.v2.ColumnFamily} - * - * @property {Object} update - * Update an existing column family to the specified schema, or fail - * if no column family exists with the given ID. - * - * This object should have the same structure as [ColumnFamily]{@link google.bigtable.admin.v2.ColumnFamily} - * - * @property {boolean} drop - * Drop (delete) the column family with the given ID, or fail if no such - * family exists. - * - * @typedef Modification - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ - Modification: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken - * - * @property {string} 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}`. - * - * @typedef GenerateConsistencyTokenRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GenerateConsistencyTokenRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const GenerateConsistencyTokenRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for - * google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken - * - * @property {string} consistencyToken - * The generated consistency token. - * - * @typedef GenerateConsistencyTokenResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GenerateConsistencyTokenResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const GenerateConsistencyTokenResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency - * - * @property {string} 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}`. - * - * @property {string} consistencyToken - * Required. The token created using GenerateConsistencyToken for the Table. - * - * @typedef CheckConsistencyRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CheckConsistencyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const CheckConsistencyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for - * google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency - * - * @property {boolean} consistent - * True only if the token is consistent. A token is consistent if replication - * has caught up with the restrictions specified in the request. - * - * @typedef CheckConsistencyResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CheckConsistencyResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const CheckConsistencyResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * 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. - * - * @property {string} name - * The unique name of the table to have the snapshot taken. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * - * @property {string} cluster - * The name of the cluster where the snapshot will be created in. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * - * @property {string} snapshotId - * 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`. - * - * @property {Object} 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. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {string} description - * Description of the snapshot. - * - * @typedef SnapshotTableRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.SnapshotTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const SnapshotTableRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * 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. - * - * @property {string} name - * Required. The unique name of the requested snapshot. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * - * @typedef GetSnapshotRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GetSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const GetSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * 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. - * - * @property {string} 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/-`. - * - * @property {number} pageSize - * The maximum number of snapshots to return per page. - * CURRENTLY UNIMPLEMENTED AND IGNORED. - * - * @property {string} pageToken - * The value of `next_page_token` returned by a previous call. - * - * @typedef ListSnapshotsRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListSnapshotsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const ListSnapshotsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for - * 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. - * - * @property {Object[]} snapshots - * The snapshots present in the requested cluster. - * - * This object should have the same structure as [Snapshot]{@link google.bigtable.admin.v2.Snapshot} - * - * @property {string} nextPageToken - * 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. - * - * @typedef ListSnapshotsResponse - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ListSnapshotsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const ListSnapshotsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for - * 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. - * - * @property {string} name - * Required. The unique name of the snapshot to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * - * @typedef DeleteSnapshotRequest - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.DeleteSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const DeleteSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * 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. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this SnapshotTable operation. - * - * This object should have the same structure as [SnapshotTableRequest]{@link google.bigtable.admin.v2.SnapshotTableRequest} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef SnapshotTableMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.SnapshotTableMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const SnapshotTableMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * 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. - * - * @property {Object} originalRequest - * The request that prompted the initiation of this CreateTableFromSnapshot - * operation. - * - * This object should have the same structure as [CreateTableFromSnapshotRequest]{@link google.bigtable.admin.v2.CreateTableFromSnapshotRequest} - * - * @property {Object} requestTime - * The time at which the original request was received. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} finishTime - * The time at which the operation failed or was completed successfully. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef CreateTableFromSnapshotMetadata - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.CreateTableFromSnapshotMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} - */ -const CreateTableFromSnapshotMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_instance.js b/src/v2/doc/google/bigtable/admin/v2/doc_instance.js deleted file mode 100644 index 896596fa3..000000000 --- a/src/v2/doc/google/bigtable/admin/v2/doc_instance.js +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A collection of Bigtable Tables and - * the resources that serve them. - * All tables in an instance are served from all - * Clusters in the instance. - * - * @property {string} name - * The unique name of the instance. Values are of the form - * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. - * - * @property {string} 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. - * - * @property {number} state - * (`OutputOnly`) - * The current state of the instance. - * - * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} - * - * @property {number} type - * The type of the instance. Defaults to `PRODUCTION`. - * - * The number should be among the values of [Type]{@link google.bigtable.admin.v2.Type} - * - * @property {Object.} 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. - * - * @typedef Instance - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.Instance definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} - */ -const Instance = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Possible states of an instance. - * - * @enum {number} - * @memberof google.bigtable.admin.v2 - */ - 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 {number} - * @memberof google.bigtable.admin.v2 - */ - 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, - - /** - * The instance is meant for development and testing purposes only; it has - * no performance or uptime guarantees and is not covered by SLA. - * After a development instance is created, it can be upgraded by - * updating the instance to type `PRODUCTION`. An instance created - * as a production instance cannot be changed to a development instance. - * When creating a development instance, `serve_nodes` on the cluster must - * not be set. - */ - DEVELOPMENT: 2 - } -}; - -/** - * A resizable group of nodes in a particular cloud location, capable - * of serving all Tables in the parent - * Instance. - * - * @property {string} name - * The unique name of the cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. - * - * @property {string} location - * (`CreationOnly`) - * 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}`. - * - * @property {number} state - * The current state of the cluster. - * - * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} - * - * @property {number} serveNodes - * Required. The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. - * - * @property {number} defaultStorageType - * (`CreationOnly`) - * The type of storage used by this cluster to serve its - * parent instance's tables, unless explicitly overridden. - * - * The number should be among the values of [StorageType]{@link google.bigtable.admin.v2.StorageType} - * - * @typedef Cluster - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.Cluster definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} - */ -const Cluster = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Possible states of a cluster. - * - * @enum {number} - * @memberof google.bigtable.admin.v2 - */ - 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 - } -}; - -/** - * A configuration object describing how Cloud Bigtable should treat traffic - * from a particular end user application. - * - * @property {string} name - * (`OutputOnly`) - * The unique name of the app profile. Values are of the form - * `projects//instances//appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - * - * @property {string} etag - * 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. - * - * @property {string} description - * Optional long form description of the use case for this AppProfile. - * - * @property {Object} multiClusterRoutingUseAny - * Use a multi-cluster routing policy. - * - * This object should have the same structure as [MultiClusterRoutingUseAny]{@link google.bigtable.admin.v2.MultiClusterRoutingUseAny} - * - * @property {Object} singleClusterRouting - * Use a single-cluster routing policy. - * - * This object should have the same structure as [SingleClusterRouting]{@link google.bigtable.admin.v2.SingleClusterRouting} - * - * @typedef AppProfile - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.AppProfile definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} - */ -const AppProfile = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * 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. - * @typedef MultiClusterRoutingUseAny - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} - */ - MultiClusterRoutingUseAny: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Unconditionally routes all read/write requests to a specific cluster. - * This option preserves read-your-writes consistency but does not improve - * availability. - * - * @property {string} clusterId - * The cluster to which read/write requests should be routed. - * - * @property {boolean} 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. - * - * @typedef SingleClusterRouting - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.AppProfile.SingleClusterRouting definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} - */ - SingleClusterRouting: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_table.js b/src/v2/doc/google/bigtable/admin/v2/doc_table.js deleted file mode 100644 index d480f2ccf..000000000 --- a/src/v2/doc/google/bigtable/admin/v2/doc_table.js +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A collection of user data indexed by row, column, and timestamp. - * Each table is served using the resources of its parent cluster. - * - * @property {string} name - * Output only. The unique name of the table. Values are of the form - * `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` - * - * @property {Object.} clusterStates - * 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`, `FULL` - * - * @property {Object.} columnFamilies - * (`CreationOnly`) - * The column families configured for this table, mapped by column family ID. - * Views: `SCHEMA_VIEW`, `FULL` - * - * @property {number} granularity - * (`CreationOnly`) - * 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`. - * - * The number should be among the values of [TimestampGranularity]{@link google.bigtable.admin.v2.TimestampGranularity} - * - * @typedef Table - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.Table definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ -const Table = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The state of a table's data in a particular cluster. - * - * @property {number} replicationState - * Output only. The state of replication for the table in this cluster. - * - * The number should be among the values of [ReplicationState]{@link google.bigtable.admin.v2.ReplicationState} - * - * @typedef ClusterState - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.Table.ClusterState definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ - ClusterState: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Table replication states. - * - * @enum {number} - * @memberof google.bigtable.admin.v2 - */ - 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 - } - }, - - /** - * Possible timestamp granularities to use when keeping multiple versions - * of data in a table. - * - * @enum {number} - * @memberof google.bigtable.admin.v2 - */ - 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 {number} - * @memberof google.bigtable.admin.v2 - */ - 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, - - /** - * Populates all fields. - */ - FULL: 4 - } -}; - -/** - * A set of columns within a table which share a common configuration. - * - * @property {Object} gcRule - * 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. - * - * This object should have the same structure as [GcRule]{@link google.bigtable.admin.v2.GcRule} - * - * @typedef ColumnFamily - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.ColumnFamily definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ -const ColumnFamily = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Rule for determining which cells to delete during garbage collection. - * - * @property {number} maxNumVersions - * Delete all cells in a column except the most recent N. - * - * @property {Object} maxAge - * Delete cells in a column older than the given age. - * Values must be at least one millisecond, and will be truncated to - * microsecond granularity. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} intersection - * Delete cells that would be deleted by every nested rule. - * - * This object should have the same structure as [Intersection]{@link google.bigtable.admin.v2.Intersection} - * - * @property {Object} union - * Delete cells that would be deleted by any nested rule. - * - * This object should have the same structure as [Union]{@link google.bigtable.admin.v2.Union} - * - * @typedef GcRule - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GcRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ -const GcRule = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A GcRule which deletes cells matching all of the given rules. - * - * @property {Object[]} rules - * Only delete cells which would be deleted by every element of `rules`. - * - * This object should have the same structure as [GcRule]{@link google.bigtable.admin.v2.GcRule} - * - * @typedef Intersection - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GcRule.Intersection definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ - Intersection: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A GcRule which deletes cells matching any of the given rules. - * - * @property {Object[]} rules - * Delete cells which would be deleted by any element of `rules`. - * - * This object should have the same structure as [GcRule]{@link google.bigtable.admin.v2.GcRule} - * - * @typedef Union - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.GcRule.Union definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ - Union: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * 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. - * - * @property {string} name - * Output only. The unique name of the snapshot. - * Values are of the form - * `projects//instances//clusters//snapshots/`. - * - * @property {Object} sourceTable - * Output only. The source table at the time the snapshot was taken. - * - * This object should have the same structure as [Table]{@link google.bigtable.admin.v2.Table} - * - * @property {number} dataSizeBytes - * 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. - * - * @property {Object} createTime - * Output only. The time when the snapshot is created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} deleteTime - * 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. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {number} state - * Output only. The current state of the snapshot. - * - * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} - * - * @property {string} description - * Output only. Description of the snapshot. - * - * @typedef Snapshot - * @memberof google.bigtable.admin.v2 - * @see [google.bigtable.admin.v2.Snapshot definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} - */ -const Snapshot = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Possible states of a snapshot. - * - * @enum {number} - * @memberof google.bigtable.admin.v2 - */ - 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 - } -}; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/v2/doc_bigtable.js b/src/v2/doc/google/bigtable/v2/doc_bigtable.js deleted file mode 100644 index 59f3d5106..000000000 --- a/src/v2/doc/google/bigtable/v2/doc_bigtable.js +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for Bigtable.ReadRows. - * - * @property {string} tableName - * Required. The unique name of the table from which to read. - * Values are of the form - * `projects//instances//tables/
`. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @property {Object} rows - * The row keys and/or ranges to read. If not specified, reads from all rows. - * - * This object should have the same structure as [RowSet]{@link google.bigtable.v2.RowSet} - * - * @property {Object} filter - * The filter to apply to the contents of the specified row(s). If unset, - * reads the entirety of each row. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @property {number} rowsLimit - * The read will terminate after committing to N rows' worth of results. The - * default (zero) is to return all results. - * - * @typedef ReadRowsRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadRowsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const ReadRowsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for Bigtable.ReadRows. - * - * @property {Object[]} chunks - * A collection of a row's contents as part of the read request. - * - * This object should have the same structure as [CellChunk]{@link google.bigtable.v2.CellChunk} - * - * @property {Buffer} lastScannedRowKey - * 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. - * - * @typedef ReadRowsResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadRowsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const ReadRowsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Specifies a piece of a row's contents returned as part of the read - * response stream. - * - * @property {Buffer} rowKey - * 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. - * - * @property {Object} familyName - * 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. - * - * This object should have the same structure as [StringValue]{@link google.protobuf.StringValue} - * - * @property {Object} qualifier - * 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. - * - * This object should have the same structure as [BytesValue]{@link google.protobuf.BytesValue} - * - * @property {number} timestampMicros - * 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). - * - * @property {string[]} labels - * Labels applied to the cell by a - * RowFilter. Labels are only set - * on the first CellChunk per cell. - * - * @property {Buffer} value - * 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. - * - * @property {number} valueSize - * 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. - * - * @property {boolean} resetRow - * Indicates that the client should drop all previous chunks for - * `row_key`, as it will be re-read from the beginning. - * - * @property {boolean} commitRow - * Indicates that the client can safely process all previous chunks for - * `row_key`, as its data has been fully read. - * - * @typedef CellChunk - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadRowsResponse.CellChunk definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ - CellChunk: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for Bigtable.SampleRowKeys. - * - * @property {string} tableName - * Required. The unique name of the table from which to sample row keys. - * Values are of the form - * `projects//instances//tables/
`. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @typedef SampleRowKeysRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.SampleRowKeysRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const SampleRowKeysRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for Bigtable.SampleRowKeys. - * - * @property {Buffer} rowKey - * 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. - * - * @property {number} offsetBytes - * 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. - * - * @typedef SampleRowKeysResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.SampleRowKeysResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const SampleRowKeysResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for Bigtable.MutateRow. - * - * @property {string} tableName - * Required. The unique name of the table to which the mutation should be applied. - * Values are of the form - * `projects//instances//tables/
`. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @property {Buffer} rowKey - * Required. The key of the row to which the mutation should be applied. - * - * @property {Object[]} 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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * - * @typedef MutateRowRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const MutateRowRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for Bigtable.MutateRow. - * @typedef MutateRowResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const MutateRowResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for BigtableService.MutateRows. - * - * @property {string} tableName - * Required. The unique name of the table to which the mutations should be applied. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @property {Object[]} 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. - * - * This object should have the same structure as [Entry]{@link google.bigtable.v2.Entry} - * - * @typedef MutateRowsRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const MutateRowsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A mutation for a given row. - * - * @property {Buffer} rowKey - * The key of the row to which the `mutations` should be applied. - * - * @property {Object[]} mutations - * 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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * - * @typedef Entry - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowsRequest.Entry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ - Entry: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Response message for BigtableService.MutateRows. - * - * @property {Object[]} entries - * One or more results for Entries from the batch request. - * - * This object should have the same structure as [Entry]{@link google.bigtable.v2.Entry} - * - * @typedef MutateRowsResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const MutateRowsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The result of applying a passed mutation in the original request. - * - * @property {number} index - * The index into the original request's `entries` list of the Entry - * for which a result is being reported. - * - * @property {Object} status - * 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. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @typedef Entry - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.MutateRowsResponse.Entry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ - Entry: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for Bigtable.CheckAndMutateRow. - * - * @property {string} tableName - * Required. The unique name of the table to which the conditional mutation should be - * applied. - * Values are of the form - * `projects//instances//tables/
`. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @property {Buffer} rowKey - * Required. The key of the row to which the conditional mutation should be applied. - * - * @property {Object} 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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @property {Object[]} 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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * - * @property {Object[]} 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. - * - * This object should have the same structure as [Mutation]{@link google.bigtable.v2.Mutation} - * - * @typedef CheckAndMutateRowRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.CheckAndMutateRowRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const CheckAndMutateRowRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for Bigtable.CheckAndMutateRow. - * - * @property {boolean} predicateMatched - * Whether or not the request's `predicate_filter` yielded any results for - * the specified row. - * - * @typedef CheckAndMutateRowResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.CheckAndMutateRowResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const CheckAndMutateRowResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for Bigtable.ReadModifyWriteRow. - * - * @property {string} tableName - * Required. The unique name of the table to which the read/modify/write rules should be - * applied. - * Values are of the form - * `projects//instances//tables/
`. - * - * @property {string} appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * - * @property {Buffer} rowKey - * Required. The key of the row to which the read/modify/write rules should be applied. - * - * @property {Object[]} 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. - * - * This object should have the same structure as [ReadModifyWriteRule]{@link google.bigtable.v2.ReadModifyWriteRule} - * - * @typedef ReadModifyWriteRowRequest - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadModifyWriteRowRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const ReadModifyWriteRowRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for Bigtable.ReadModifyWriteRow. - * - * @property {Object} row - * A Row containing the new contents of all cells modified by the request. - * - * This object should have the same structure as [Row]{@link google.bigtable.v2.Row} - * - * @typedef ReadModifyWriteRowResponse - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadModifyWriteRowResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/bigtable.proto} - */ -const ReadModifyWriteRowResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/v2/doc_data.js b/src/v2/doc/google/bigtable/v2/doc_data.js deleted file mode 100644 index c400db0c3..000000000 --- a/src/v2/doc/google/bigtable/v2/doc_data.js +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Specifies the complete (requested) contents of a single row of a table. - * Rows which exceed 256MiB in size cannot be read in full. - * - * @property {Buffer} key - * 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. - * - * @property {Object[]} families - * May be empty, but only if the entire row is empty. - * The mutual ordering of column families is not specified. - * - * This object should have the same structure as [Family]{@link google.bigtable.v2.Family} - * - * @typedef Row - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Row definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const Row = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies (some of) the contents of a single row/column family intersection - * of a table. - * - * @property {string} name - * 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. - * - * @property {Object[]} columns - * Must not be empty. Sorted in order of increasing "qualifier". - * - * This object should have the same structure as [Column]{@link google.bigtable.v2.Column} - * - * @typedef Family - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Family definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const Family = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies (some of) the contents of a single row/column intersection of a - * table. - * - * @property {Buffer} qualifier - * 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. - * - * @property {Object[]} cells - * Must not be empty. Sorted in order of decreasing "timestamp_micros". - * - * This object should have the same structure as [Cell]{@link google.bigtable.v2.Cell} - * - * @typedef Column - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Column definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const Column = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies (some of) the contents of a single row/column/timestamp of a table. - * - * @property {number} timestampMicros - * 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. - * - * @property {Buffer} value - * The value stored in the cell. - * May contain any byte string, including the empty string, up to 100MiB in - * length. - * - * @property {string[]} labels - * Labels applied to the cell by a RowFilter. - * - * @typedef Cell - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Cell definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const Cell = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies a contiguous range of rows. - * - * @property {Buffer} startKeyClosed - * Used when giving an inclusive lower bound for the range. - * - * @property {Buffer} startKeyOpen - * Used when giving an exclusive lower bound for the range. - * - * @property {Buffer} endKeyOpen - * Used when giving an exclusive upper bound for the range. - * - * @property {Buffer} endKeyClosed - * Used when giving an inclusive upper bound for the range. - * - * @typedef RowRange - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const RowRange = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies a non-contiguous set of rows. - * - * @property {Buffer[]} rowKeys - * Single rows included in the set. - * - * @property {Object[]} rowRanges - * Contiguous row ranges included in the set. - * - * This object should have the same structure as [RowRange]{@link google.bigtable.v2.RowRange} - * - * @typedef RowSet - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const RowSet = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * 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. - * - * @property {string} familyName - * The name of the column family within which this range falls. - * - * @property {Buffer} startQualifierClosed - * Used when giving an inclusive lower bound for the range. - * - * @property {Buffer} startQualifierOpen - * Used when giving an exclusive lower bound for the range. - * - * @property {Buffer} endQualifierClosed - * Used when giving an inclusive upper bound for the range. - * - * @property {Buffer} endQualifierOpen - * Used when giving an exclusive upper bound for the range. - * - * @typedef ColumnRange - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ColumnRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const ColumnRange = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specified a contiguous range of microsecond timestamps. - * - * @property {number} startTimestampMicros - * Inclusive lower bound. If left empty, interpreted as 0. - * - * @property {number} endTimestampMicros - * Exclusive upper bound. If left empty, interpreted as infinity. - * - * @typedef TimestampRange - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.TimestampRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const TimestampRange = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Specifies a contiguous range of raw byte values. - * - * @property {Buffer} startValueClosed - * Used when giving an inclusive lower bound for the range. - * - * @property {Buffer} startValueOpen - * Used when giving an exclusive lower bound for the range. - * - * @property {Buffer} endValueClosed - * Used when giving an inclusive upper bound for the range. - * - * @property {Buffer} endValueOpen - * Used when giving an exclusive upper bound for the range. - * - * @typedef ValueRange - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ValueRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const ValueRange = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * 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 4096 bytes, and RowFilters may not be nested within each other - * (in Chains or Interleaves) to a depth of more than 20. - * - * @property {Object} chain - * Applies several RowFilters to the data in sequence, progressively - * narrowing the results. - * - * This object should have the same structure as [Chain]{@link google.bigtable.v2.Chain} - * - * @property {Object} interleave - * Applies several RowFilters to the data in parallel and combines the - * results. - * - * This object should have the same structure as [Interleave]{@link google.bigtable.v2.Interleave} - * - * @property {Object} condition - * Applies one of two possible RowFilters to the data based on the output of - * a predicate RowFilter. - * - * This object should have the same structure as [Condition]{@link google.bigtable.v2.Condition} - * - * @property {boolean} sink - * 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, - * 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. - * - * @property {boolean} passAllFilter - * Matches all cells, regardless of input. Functionally equivalent to - * leaving `filter` unset, but included for completeness. - * - * @property {boolean} blockAllFilter - * Does not match any cells, regardless of input. Useful for temporarily - * disabling just part of a filter. - * - * @property {Buffer} rowKeyRegexFilter - * 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. - * - * @property {number} rowSampleFilter - * Matches all cells from a row with probability p, and matches no cells - * from the row with probability 1-p. - * - * @property {string} familyNameRegexFilter - * 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. - * - * @property {Buffer} columnQualifierRegexFilter - * 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. - * - * @property {Object} columnRangeFilter - * Matches only cells from columns within the given range. - * - * This object should have the same structure as [ColumnRange]{@link google.bigtable.v2.ColumnRange} - * - * @property {Object} timestampRangeFilter - * Matches only cells with timestamps within the given range. - * - * This object should have the same structure as [TimestampRange]{@link google.bigtable.v2.TimestampRange} - * - * @property {Buffer} valueRegexFilter - * 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. - * - * @property {Object} valueRangeFilter - * Matches only cells with values that fall within the given range. - * - * This object should have the same structure as [ValueRange]{@link google.bigtable.v2.ValueRange} - * - * @property {number} cellsPerRowOffsetFilter - * 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. - * - * @property {number} cellsPerRowLimitFilter - * 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. - * - * @property {number} cellsPerColumnLimitFilter - * 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. - * - * @property {boolean} stripValueTransformer - * Replaces each cell's value with the empty string. - * - * @property {string} applyLabelTransformer - * 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. - * - * @typedef RowFilter - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowFilter definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const RowFilter = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A RowFilter which sends rows through several RowFilters in sequence. - * - * @property {Object[]} filters - * 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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @typedef Chain - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowFilter.Chain definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - Chain: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A RowFilter which sends each row to each of several component - * RowFilters and interleaves the results. - * - * @property {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. - * 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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @typedef Interleave - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowFilter.Interleave definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - Interleave: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * 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. - * - * @property {Object} predicateFilter - * If `predicate_filter` outputs any cells, then `true_filter` will be - * evaluated on the input row. Otherwise, `false_filter` will be evaluated. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @property {Object} trueFilter - * 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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @property {Object} falseFilter - * 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. - * - * This object should have the same structure as [RowFilter]{@link google.bigtable.v2.RowFilter} - * - * @typedef Condition - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.RowFilter.Condition definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - Condition: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Specifies a particular change to be made to the contents of a row. - * - * @property {Object} setCell - * Set a cell's value. - * - * This object should have the same structure as [SetCell]{@link google.bigtable.v2.SetCell} - * - * @property {Object} deleteFromColumn - * Deletes cells from a column. - * - * This object should have the same structure as [DeleteFromColumn]{@link google.bigtable.v2.DeleteFromColumn} - * - * @property {Object} deleteFromFamily - * Deletes cells from a column family. - * - * This object should have the same structure as [DeleteFromFamily]{@link google.bigtable.v2.DeleteFromFamily} - * - * @property {Object} deleteFromRow - * Deletes cells from the entire row. - * - * This object should have the same structure as [DeleteFromRow]{@link google.bigtable.v2.DeleteFromRow} - * - * @typedef Mutation - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Mutation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const Mutation = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A Mutation which sets the value of the specified cell. - * - * @property {string} familyName - * The name of the family into which new data should be written. - * Must match `[-_.a-zA-Z0-9]+` - * - * @property {Buffer} columnQualifier - * The qualifier of the column into which new data should be written. - * Can be any byte string, including the empty string. - * - * @property {number} timestampMicros - * 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). - * - * @property {Buffer} value - * The value to be written into the specified cell. - * - * @typedef SetCell - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Mutation.SetCell definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - SetCell: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A Mutation which deletes cells from the specified column, optionally - * restricting the deletions to a given timestamp range. - * - * @property {string} familyName - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * @property {Buffer} columnQualifier - * The qualifier of the column from which cells should be deleted. - * Can be any byte string, including the empty string. - * - * @property {Object} timeRange - * The range of timestamps within which cells should be deleted. - * - * This object should have the same structure as [TimestampRange]{@link google.bigtable.v2.TimestampRange} - * - * @typedef DeleteFromColumn - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Mutation.DeleteFromColumn definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - DeleteFromColumn: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A Mutation which deletes all cells from the specified column family. - * - * @property {string} familyName - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * @typedef DeleteFromFamily - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Mutation.DeleteFromFamily definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - DeleteFromFamily: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A Mutation which deletes all cells from the containing row. - * @typedef DeleteFromRow - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.Mutation.DeleteFromRow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ - DeleteFromRow: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Specifies an atomic read/modify/write operation on the latest value of the - * specified column. - * - * @property {string} familyName - * The name of the family to which the read/modify/write should be applied. - * Must match `[-_.a-zA-Z0-9]+` - * - * @property {Buffer} columnQualifier - * The qualifier of the column to which the read/modify/write should be - * applied. - * Can be any byte string, including the empty string. - * - * @property {Buffer} appendValue - * 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. - * - * @property {number} incrementAmount - * 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. - * - * @typedef ReadModifyWriteRule - * @memberof google.bigtable.v2 - * @see [google.bigtable.v2.ReadModifyWriteRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto} - */ -const ReadModifyWriteRule = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/iam/v1/doc_iam_policy.js b/src/v2/doc/google/iam/v1/doc_iam_policy.js deleted file mode 100644 index 2a58fee6a..000000000 --- a/src/v2/doc/google/iam/v1/doc_iam_policy.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for `SetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} 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. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @typedef SetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const SetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `GetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * - * @typedef GetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const GetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `TestIamPermissions` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {string[]} 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). - * - * @typedef TestIamPermissionsRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for `TestIamPermissions` method. - * - * @property {string[]} permissions - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - * - * @typedef TestIamPermissionsResponse - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/iam/v1/doc_options.js b/src/v2/doc/google/iam/v1/doc_options.js deleted file mode 100644 index ed4e25db8..000000000 --- a/src/v2/doc/google/iam/v1/doc_options.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Encapsulates settings provided to GetIamPolicy. - * - * @property {number} requestedPolicyVersion - * Optional. 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. - * - * @typedef GetPolicyOptions - * @memberof google.iam.v1 - * @see [google.iam.v1.GetPolicyOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/options.proto} - */ -const GetPolicyOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/iam/v1/doc_policy.js b/src/v2/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7a..000000000 --- a/src/v2/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/longrunning/doc_operations.js b/src/v2/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d6..000000000 --- a/src/v2/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_any.js b/src/v2/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa3..000000000 --- a/src/v2/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_duration.js b/src/v2/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee60..000000000 --- a/src/v2/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_empty.js b/src/v2/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d66..000000000 --- a/src/v2/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_field_mask.js b/src/v2/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36..000000000 --- a/src/v2/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_timestamp.js b/src/v2/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index c86af4e3d..000000000 --- a/src/v2/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_wrappers.js b/src/v2/doc/google/protobuf/doc_wrappers.js deleted file mode 100644 index a87829cf8..000000000 --- a/src/v2/doc/google/protobuf/doc_wrappers.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Wrapper message for `string`. - * - * The JSON representation for `StringValue` is JSON string. - * - * @property {string} value - * The string value. - * - * @typedef StringValue - * @memberof google.protobuf - * @see [google.protobuf.StringValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto} - */ -const StringValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Wrapper message for `bytes`. - * - * The JSON representation for `BytesValue` is JSON string. - * - * @property {Buffer} value - * The bytes value. - * - * @typedef BytesValue - * @memberof google.protobuf - * @see [google.protobuf.BytesValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto} - */ -const BytesValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/rpc/doc_status.js b/src/v2/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af76..000000000 --- a/src/v2/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/doc/google/type/doc_expr.js b/src/v2/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde5..000000000 --- a/src/v2/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v2/index.ts b/src/v2/index.ts new file mode 100644 index 000000000..5ad012de7 --- /dev/null +++ b/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 './bigtable_instance_admin_client'; +export {BigtableTableAdminClient} from './bigtable_table_admin_client'; +export {BigtableClient} from './bigtable_client'; diff --git a/synth.metadata b/synth.metadata index 254d536b6..26a6c238d 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,13 @@ { - "updateTime": "2020-02-29T12:15:50.137807Z", + "updateTime": "2020-03-09T20:59:02.094623Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.47.0", - "dockerImage": "googleapis/artman@sha256:b3e50d6b8de03920b9f065bbc3d210e2ca93a043446f1fa16cdf567393c09678" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\ne46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n" + "sha": "29a47c965aac79e3fe8e3314482ca0b5967680f0", + "internalRef": "299917154", + "log": "29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n" } }, { @@ -31,9 +24,8 @@ "source": "googleapis", "apiName": "bigtable", "apiVersion": "v2", - "language": "nodejs", - "generator": "gapic", - "config": "google/bigtable/artman_bigtable.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -41,9 +33,8 @@ "source": "googleapis", "apiName": "bigtable_admin", "apiVersion": "v2", - "language": "nodejs", - "generator": "gapic", - "config": "google/bigtable/admin/artman_bigtableadmin.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ] diff --git a/synth.py b/synth.py index 899e5bdd1..2244d6a75 100644 --- a/synth.py +++ b/synth.py @@ -5,46 +5,53 @@ import os logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -v2_library = gapic.node_library( +version='v2' +gapic = gcp.GAPICMicrogenerator() +v2_library = gapic.typescript_library( 'bigtable', - 'v2', - config_path='/google/bigtable/artman_bigtable.yaml' -) - + version, + generator_args={ + "grpc-service-config": f"google/bigtable/{version}/bigtable_grpc_service_config.json", + "package-name": f"@google-cloud/bigtable", + "main-service": f"bigtable" + }, + proto_path=f'/google/bigtable/{version}', + extra_proto_files=['google/cloud/common_resources.proto'], + ) +# src/index.ts src/v2/index.ts has added AdminClients manually, we don't wanna 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 s.copy( v2_library, - excludes=['package.json', 'README.md', 'src/index.js', 'src/v2/index.js'] + excludes=['package.json', 'README.md', 'src/index.ts', 'src/v2/index.ts', 'tsconfig.json', 'tslint.json'] ) -v2_library = gapic.node_library( +v2_library = gapic.typescript_library( "bigtable_admin", - "v2", - config_path="/google/bigtable/admin/artman_bigtableadmin.yaml", - artman_output_name="bigtable-admin-v2" -) - + version, + generator_args={ + "grpc-service-config": f"google/bigtable/admin/{version}/bigtableadmin_grpc_service_config.json", + "package-name": f"@google-cloud/bigtable", + "main-service": f"bigtable" + }, + proto_path=f'/google/bigtable/admin/{version}', + extra_proto_files=['google/cloud/common_resources.proto'], + ) +# Not override system-test for admin/v2, just keep the v2 version. s.copy( v2_library, - excludes=['package.json', 'README.md', 'src/index.js', 'src/v2/index.js'] + excludes=['package.json', 'README.md', 'src/index.ts', 'src/v2/index.ts', 'tsconfig.json', 'tslint.json', 'system-test/fixtures/sample/src/index.ts', 'system-test/fixtures/sample/src/index.js'] ) - -# Update path discovery due to build/ dir and TypeScript conversion. -s.replace("src/v2/bigtable_client.js", "../../package.json", "../../../package.json") -s.replace("src/v2/bigtable_instance_admin_client.js", "../../package.json", "../../../package.json") -s.replace("src/v2/bigtable_table_admin_client.js", "../../package.json", "../../../package.json") - - +# Replace the client name for generated system-test. +system_test_files=['system-test/fixtures/sample/src/index.ts','system-test/fixtures/sample/src/index.js'] +for file in system_test_files: + s.replace(file, 'BigtableClient', 'Bigtable') common_templates = gcp.CommonTemplates() templates = common_templates.node_library( source_location='build/src' ) -s.copy(templates, excludes=['.jsdoc.js']) - -# No webpack support for TypeScript libraries yet -os.unlink("webpack.config.js") -os.unlink("src/browser.js") +s.copy(templates) subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) diff --git a/system-test/fixtures/sample/package.json b/system-test/fixtures/sample/package.json deleted file mode 100644 index 33b59272d..000000000 --- a/system-test/fixtures/sample/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "bigtable-sample-fixture", - "description": "An app we're using to test the library.", - "scripts": { - "check": "gts check", - "clean": "gts clean", - "compile": "tsc -p .", - "fix": "gts fix", - "prepare": "npm run compile", - "pretest": "npm run compile", - "posttest": "npm run check", - "start": "node build/src/index.js" - }, - "license": "Apache-2.0", - "dependencies": { - "@google-cloud/bigtable": "file:./bigtable.tgz" - }, - "devDependencies": { - "@types/node": "^10.3.0", - "typescript": "^3.0.0", - "gts": "^1.0.0" - } -} diff --git a/src/v2/index.js b/system-test/fixtures/sample/src/index.js similarity index 55% rename from src/v2/index.js rename to system-test/fixtures/sample/src/index.js index 18aa2999b..1f82e94c6 100644 --- a/src/v2/index.js +++ b/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,13 +11,16 @@ // WITHOUT 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'; +/* eslint-disable node/no-missing-require, no-unused-vars */ +const bigtable = require('@google-cloud/bigtable'); -const BigtableClient = require('./bigtable_client'); -const BigtableInstanceAdminClient = require('./bigtable_instance_admin_client'); -const BigtableTableAdminClient = require('./bigtable_table_admin_client'); +function main() { + const bigtableClient = new bigtable.Bigtable(); +} -module.exports.BigtableClient = BigtableClient; -module.exports.BigtableInstanceAdminClient = BigtableInstanceAdminClient; -module.exports.BigtableTableAdminClient = BigtableTableAdminClient; +main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts index 9791c17b9..6eb17785e 100644 --- a/system-test/fixtures/sample/src/index.ts +++ b/system-test/fixtures/sample/src/index.ts @@ -4,17 +4,22 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** import {Bigtable} from '@google-cloud/bigtable'; -async function main() { - const bigtable = new Bigtable(); - console.log(bigtable); + +function main() { + const bigtableClient = new Bigtable(); } + main(); diff --git a/system-test/fixtures/sample/tsconfig.json b/system-test/fixtures/sample/tsconfig.json deleted file mode 100644 index ba3a016c1..000000000 --- a/system-test/fixtures/sample/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "types": ["node"] - }, - "include": [ - "src/*.ts" - ] -} diff --git a/system-test/install.ts b/system-test/install.ts index 613992e98..c9aa74ec2 100644 --- a/system-test/install.ts +++ b/system-test/install.ts @@ -4,54 +4,48 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -import * as execa from 'execa'; -import * as mv from 'mv'; -import {ncp} from 'ncp'; -import * as tmp from 'tmp'; -import {promisify} from 'util'; - -const keep = false; -const mvp = (promisify(mv) as {}) as (...args: string[]) => Promise; -const ncpp = promisify(ncp); -const stagingDir = tmp.dirSync({keep, unsafeCleanup: true}); -const stagingPath = stagingDir.name; - -const pkg = require('../../package.json'); +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; -describe('📦 pack and install', () => { - /** - * Create a staging directory with temp fixtures used to test on a fresh - * application. - */ - it('should be able to use the d.ts', async () => { - await execa('npm', ['pack', '--unsafe-perm']); - const tarball = `google-cloud-bigtable-${pkg.version}.tgz`; - await mvp(tarball, `${stagingPath}/bigtable.tgz`); - await ncpp('system-test/fixtures/sample', `${stagingPath}/`); - await execa('npm', ['install', '--unsafe-perm'], { - cwd: `${stagingPath}/`, - stdio: 'inherit', - }); - await execa('node', ['--throw-deprecation', 'build/src/index.js'], { - cwd: `${stagingPath}/`, - stdio: 'inherit', - }); +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. }); - /** - * CLEAN UP - remove the staging directory when done. - */ - after('cleanup staging', () => { - if (!keep) { - stagingDir.removeCallback(); - } + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. }); }); diff --git a/test/gapic-bigtable-v2.ts b/test/gapic-bigtable-v2.ts new file mode 100644 index 000000000..1b6b08366 --- /dev/null +++ b/test/gapic-bigtable-v2.ts @@ -0,0 +1,455 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const bigtableModule = require('../src'); + +import {PassThrough} from 'stream'; + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockServerStreamingGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + const mockStream = new PassThrough({ + objectMode: true, + transform: (chunk: {}, enc: {}, callback: Callback) => { + if (error) { + callback(error); + } else { + callback(null, response); + } + }, + }); + return mockStream; + }; +} +describe('v2.BigtableClient', () => { + it('has servicePath', () => { + const servicePath = bigtableModule.v2.BigtableClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = bigtableModule.v2.BigtableClient.apiEndpoint; + assert(apiEndpoint); + }); + 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', () => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('mutateRow', () => { + it('invokes mutateRow without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IMutateRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.mutateRow = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.mutateRow(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes mutateRow with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IMutateRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.mutateRow = mockSimpleGrpcMethod( + request, + null, + error + ); + client.mutateRow(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('checkAndMutateRow', () => { + it('invokes checkAndMutateRow without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.checkAndMutateRow = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.checkAndMutateRow(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes checkAndMutateRow with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.ICheckAndMutateRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.checkAndMutateRow = mockSimpleGrpcMethod( + request, + null, + error + ); + client.checkAndMutateRow(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('readModifyWriteRow', () => { + it('invokes readModifyWriteRow without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readModifyWriteRow = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.readModifyWriteRow(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes readModifyWriteRow with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IReadModifyWriteRowRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readModifyWriteRow = mockSimpleGrpcMethod( + request, + null, + error + ); + client.readModifyWriteRow(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('readRows', () => { + it('invokes readRows without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IReadRowsRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client.readRows(request); + stream.on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + stream.on('error', (err: FakeError) => { + done(err); + }); + stream.write(); + }); + it('invokes readRows with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IReadRowsRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + null, + error + ); + const stream = client.readRows(request); + stream.on('data', () => { + assert.fail(); + }); + stream.on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(); + }); + }); + describe('sampleRowKeys', () => { + it('invokes sampleRowKeys without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.ISampleRowKeysRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.sampleRowKeys = mockServerStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client.sampleRowKeys(request); + stream.on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + stream.on('error', (err: FakeError) => { + done(err); + }); + stream.write(); + }); + it('invokes sampleRowKeys with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.ISampleRowKeysRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.sampleRowKeys = mockServerStreamingGrpcMethod( + request, + null, + error + ); + const stream = client.sampleRowKeys(request); + stream.on('data', () => { + assert.fail(); + }); + stream.on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(); + }); + }); + describe('mutateRows', () => { + it('invokes mutateRows without error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IMutateRowsRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.mutateRows = mockServerStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client.mutateRows(request); + stream.on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + stream.on('error', (err: FakeError) => { + done(err); + }); + stream.write(); + }); + it('invokes mutateRows with error', done => { + const client = new bigtableModule.v2.BigtableClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.v2.IMutateRowsRequest = {}; + request.tableName = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.mutateRows = mockServerStreamingGrpcMethod( + request, + null, + error + ); + const stream = client.mutateRows(request); + stream.on('data', () => { + assert.fail(); + }); + stream.on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(); + }); + }); +}); diff --git a/test/gapic-bigtable_instance_admin-v2.ts b/test/gapic-bigtable_instance_admin-v2.ts new file mode 100644 index 000000000..2328ce94f --- /dev/null +++ b/test/gapic-bigtable_instance_admin-v2.ts @@ -0,0 +1,1284 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const bigtableinstanceadminModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v2.BigtableInstanceAdminClient', () => { + it('has servicePath', () => { + const servicePath = + bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + fallback: true, + } + ); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.bigtableInstanceAdminStub, undefined); + await client.initialize(); + assert(client.bigtableInstanceAdminStub); + }); + it('has close method', () => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + describe('getInstance', () => { + it('invokes getInstance without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetInstanceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getInstance = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getInstance(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getInstance with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetInstanceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getInstance(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listInstances', () => { + it('invokes listInstances without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListInstancesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listInstances = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listInstances(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listInstances with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListInstancesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listInstances = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listInstances(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateInstance', () => { + it('invokes updateInstance without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IInstance = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateInstance(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateInstance with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IInstance = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateInstance(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteInstance', () => { + it('invokes deleteInstance without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteInstance(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteInstance with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteInstanceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteInstance(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getCluster', () => { + it('invokes getCluster without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getCluster(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getCluster with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getCluster(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listClusters', () => { + it('invokes listClusters without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListClustersRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listClusters = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listClusters(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listClusters with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListClustersRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listClusters = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listClusters(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteCluster', () => { + it('invokes deleteCluster without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteCluster(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteCluster with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteCluster(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createAppProfile', () => { + it('invokes createAppProfile without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createAppProfile(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAppProfile with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateAppProfileRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createAppProfile(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getAppProfile', () => { + it('invokes getAppProfile without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getAppProfile(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getAppProfile with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetAppProfileRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getAppProfile(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteAppProfile', () => { + it('invokes deleteAppProfile without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteAppProfile(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteAppProfile with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteAppProfileRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteAppProfile(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + client.testIamPermissions(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createInstance', () => { + it('invokes createInstance without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateInstanceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createInstance(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createInstance with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateInstanceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createInstance(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('partialUpdateInstance', () => { + it('invokes partialUpdateInstance without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IPartialUpdateInstanceRequest = {}; + request.instance = {}; + request.instance.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .partialUpdateInstance(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes partialUpdateInstance with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IPartialUpdateInstanceRequest = {}; + request.instance = {}; + request.instance.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .partialUpdateInstance(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('createCluster', () => { + it('invokes createCluster without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createCluster with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateCluster', () => { + it('invokes updateCluster without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICluster = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateCluster with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICluster = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateAppProfile', () => { + it('invokes updateAppProfile without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IUpdateAppProfileRequest = {}; + request.appProfile = {}; + request.appProfile.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateAppProfile(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateAppProfile with error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IUpdateAppProfileRequest = {}; + request.appProfile = {}; + request.appProfile.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateAppProfile(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('listAppProfiles', () => { + it('invokes listAppProfiles without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listAppProfiles = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listAppProfiles(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listAppProfilesStream', () => { + it('invokes listAppProfilesStream without error', done => { + const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListAppProfilesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listAppProfiles = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listAppProfilesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-bigtable_table_admin-v2.ts b/test/gapic-bigtable_table_admin-v2.ts new file mode 100644 index 000000000..79e716342 --- /dev/null +++ b/test/gapic-bigtable_table_admin-v2.ts @@ -0,0 +1,1010 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const bigtabletableadminModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v2.BigtableTableAdminClient', () => { + it('has servicePath', () => { + const servicePath = + bigtabletableadminModule.v2.BigtableTableAdminClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + bigtabletableadminModule.v2.BigtableTableAdminClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = bigtabletableadminModule.v2.BigtableTableAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + fallback: true, + }); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigtableTableAdminStub, undefined); + await client.initialize(); + assert(client.bigtableTableAdminStub); + }); + it('has close method', () => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('createTable', () => { + it('invokes createTable without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateTableRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTable = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createTable(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createTable with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateTableRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTable = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createTable(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getTable', () => { + it('invokes getTable without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getTable = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getTable(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getTable with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getTable = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getTable(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteTable', () => { + it('invokes deleteTable without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteTable = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteTable(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteTable with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteTable = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteTable(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('modifyColumnFamilies', () => { + it('invokes modifyColumnFamilies without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.modifyColumnFamilies(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes modifyColumnFamilies with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IModifyColumnFamiliesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( + request, + null, + error + ); + client.modifyColumnFamilies(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('dropRowRange', () => { + it('invokes dropRowRange without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.dropRowRange(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes dropRowRange with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDropRowRangeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod( + request, + null, + error + ); + client.dropRowRange(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('generateConsistencyToken', () => { + it('invokes generateConsistencyToken without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.generateConsistencyToken(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes generateConsistencyToken with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( + request, + null, + error + ); + client.generateConsistencyToken( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('checkConsistency', () => { + it('invokes checkConsistency without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.checkConsistency(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes checkConsistency with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICheckConsistencyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( + request, + null, + error + ); + client.checkConsistency(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getSnapshot', () => { + it('invokes getSnapshot without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSnapshot(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSnapshot with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IGetSnapshotRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSnapshot(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteSnapshot(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteSnapshot with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IDeleteSnapshotRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteSnapshot(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + client.testIamPermissions(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createTableFromSnapshot', () => { + it('invokes createTableFromSnapshot without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createTableFromSnapshot(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createTableFromSnapshot with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createTableFromSnapshot(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('snapshotTable', () => { + it('invokes snapshotTable without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ISnapshotTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .snapshotTable(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes snapshotTable with error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.ISnapshotTableRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .snapshotTable(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('listTables', () => { + it('invokes listTables without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListTablesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listTables = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listTables(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listTablesStream', () => { + it('invokes listTablesStream without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListTablesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listTables = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listTablesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listSnapshots', () => { + it('invokes listSnapshots without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listSnapshots = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listSnapshots(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listSnapshotsStream', () => { + it('invokes listSnapshotsStream without error', done => { + const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.bigtable.admin.v2.IListSnapshotsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listSnapshots = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listSnapshotsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-v2-admin.ts b/test/gapic-v2-admin.ts deleted file mode 100644 index a9841ae88..000000000 --- a/test/gapic-v2-admin.ts +++ /dev/null @@ -1,2413 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import * as assert from 'assert'; -import {describe, it} from 'mocha'; - -const adminModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error: any = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('BigtableInstanceAdminClient', () => { - describe('createInstance', function() { - it('invokes createInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const instanceId = 'instanceId-2101995259'; - const instance = {}; - const clusters = {}; - const request = { - parent: formattedParent, - instanceId, - instance, - clusters, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name, - displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const instanceId = 'instanceId-2101995259'; - const instance = {}; - const clusters = {}; - const request = { - parent: formattedParent, - instanceId, - instance, - clusters, - }; - - // Mock Grpc layer - client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createInstance - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.createInstance - .metadataDecoder instanceof Function - ); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getInstance = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getInstance(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getInstance(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = 'nextPageToken-1530815211'; - const expectedResponse = { - nextPageToken, - }; - - // Mock Grpc layer - client._innerApiCalls.listInstances = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listInstances(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listInstances with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listInstances = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listInstances(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const displayName = 'displayName1615086568'; - const type = 'TYPE_UNSPECIFIED'; - const labels = {}; - const request = { - name: formattedName, - displayName, - type, - labels, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName2 = 'displayName21615000987'; - const expectedResponse = { - name: name2, - displayName: displayName2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateInstance(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const displayName = 'displayName1615086568'; - const type = 'TYPE_UNSPECIFIED'; - const labels = {}; - const request = { - name: formattedName, - displayName, - type, - labels, - }; - - // Mock Grpc layer - client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateInstance(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('partialUpdateInstance', function() { - it('invokes partialUpdateInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const instance = {}; - const updateMask = {}; - const request = { - instance, - updateMask, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name, - displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .partialUpdateInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes partialUpdateInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const instance = {}; - const updateMask = {}; - const request = { - instance, - updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .partialUpdateInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.partialUpdateInstance - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.partialUpdateInstance - .metadataDecoder instanceof Function - ); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod(request); - - client.deleteInstance(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteInstance(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('createCluster', function() { - it('invokes createCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const clusterId = 'clusterId240280960'; - const cluster = {}; - const request = { - parent: formattedParent, - clusterId, - cluster, - }; - - // Mock response - const name = 'name3373707'; - const location = 'location1901043637'; - const serveNodes = 1288838783; - const expectedResponse = { - name, - location, - serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const clusterId = 'clusterId240280960'; - const cluster = {}; - const request = { - parent: formattedParent, - clusterId, - cluster, - }; - - // Mock Grpc layer - client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createCluster.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.createCluster.metadataDecoder instanceof - Function - ); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const location = 'location1901043637'; - const serveNodes = 1288838783; - const expectedResponse = { - name: name2, - location, - serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.getCluster = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getCluster(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getCluster(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = 'nextPageToken-1530815211'; - const expectedResponse = { - nextPageToken, - }; - - // Mock Grpc layer - client._innerApiCalls.listClusters = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listClusters(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listClusters with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listClusters = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listClusters(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateCluster', function() { - it('invokes updateCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const location = 'location1901043637'; - const serveNodes = 1288838783; - const request = { - name: formattedName, - location, - serveNodes, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const location2 = 'location21541837352'; - const serveNodes2 = 1623486220; - const expectedResponse = { - name: name2, - location: location2, - serveNodes: serveNodes2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .updateCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes updateCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const location = 'location1901043637'; - const serveNodes = 1288838783; - const request = { - name: formattedName, - location, - serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .updateCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.updateCluster.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.updateCluster.metadataDecoder instanceof - Function - ); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod(request); - - client.deleteCluster(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteCluster(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('createAppProfile', () => { - it('invokes createAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const appProfileId = 'appProfileId1262094415'; - const appProfile = {}; - const request = { - parent: formattedParent, - appProfileId, - appProfile, - }; - - // Mock response - const name = 'name3373707'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name, - etag, - description, - }; - - // Mock Grpc layer - client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createAppProfile(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const appProfileId = 'appProfileId1262094415'; - const appProfile = {}; - const request = { - parent: formattedParent, - appProfileId, - appProfile, - }; - - // Mock Grpc layer - client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createAppProfile(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getAppProfile', () => { - it('invokes getAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - etag, - description, - }; - - // Mock Grpc layer - client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getAppProfile(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getAppProfile(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listAppProfiles', () => { - it('invokes listAppProfiles without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const appProfilesElement = {}; - const appProfiles = [appProfilesElement]; - const expectedResponse = { - nextPageToken, - appProfiles, - }; - - // Mock Grpc layer - client._innerApiCalls.listAppProfiles = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.appProfiles); - }; - - client.listAppProfiles(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.appProfiles); - done(); - }); - }); - - it('invokes listAppProfiles with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listAppProfiles = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listAppProfiles(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateAppProfile', function() { - it('invokes updateAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const appProfile = {}; - const updateMask = {}; - const request = { - appProfile, - updateMask, - }; - - // Mock response - const name = 'name3373707'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name, - etag, - description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .updateAppProfile(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes updateAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const appProfile = {}; - const updateMask = {}; - const request = { - appProfile, - updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .updateAppProfile(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.updateAppProfile - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.updateAppProfile - .metadataDecoder instanceof Function - ); - }); - }); - - describe('deleteAppProfile', () => { - it('invokes deleteAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const ignoreWarnings = true; - const request = { - name: formattedName, - ignoreWarnings, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod(request); - - client.deleteAppProfile(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const ignoreWarnings = true; - const request = { - name: formattedName, - ignoreWarnings, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteAppProfile(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version, - etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version, - etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('BigtableTableAdminClient', () => { - describe('createTable', () => { - it('invokes createTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const table = {}; - const request = { - parent: formattedParent, - tableId, - table, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name, - }; - - // Mock Grpc layer - client._innerApiCalls.createTable = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createTable(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const table = {}; - const request = { - parent: formattedParent, - tableId, - table, - }; - - // Mock Grpc layer - client._innerApiCalls.createTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createTable(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createTableFromSnapshot', function() { - it('invokes createTableFromSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const sourceSnapshot = 'sourceSnapshot-947679896'; - const request = { - parent: formattedParent, - tableId, - sourceSnapshot, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name, - }; - - // Mock Grpc layer - client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createTableFromSnapshot(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createTableFromSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const sourceSnapshot = 'sourceSnapshot-947679896'; - const request = { - parent: formattedParent, - tableId, - sourceSnapshot, - }; - - // Mock Grpc layer - client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createTableFromSnapshot(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createTableFromSnapshot - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.createTableFromSnapshot - .metadataDecoder instanceof Function - ); - }); - }); - - describe('listTables', () => { - it('invokes listTables without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const tablesElement = {}; - const tables = [tablesElement]; - const expectedResponse = { - nextPageToken, - tables, - }; - - // Mock Grpc layer - client._innerApiCalls.listTables = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.tables); - }; - - client.listTables(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.tables); - done(); - }); - }); - - it('invokes listTables with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listTables = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listTables(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getTable', () => { - it('invokes getTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getTable = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getTable(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getTable(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteTable', () => { - it('invokes deleteTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTable = mockSimpleGrpcMethod(request); - - client.deleteTable(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteTable(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('modifyColumnFamilies', () => { - it('invokes modifyColumnFamilies without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const modifications = []; - const request = { - name: formattedName, - modifications, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.modifyColumnFamilies(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes modifyColumnFamilies with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const modifications = []; - const request = { - name: formattedName, - modifications, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.modifyColumnFamilies(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('dropRowRange', () => { - it('invokes dropRowRange without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod(request); - - client.dropRowRange(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes dropRowRange with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.dropRowRange(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('generateConsistencyToken', () => { - it('invokes generateConsistencyToken without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const consistencyToken = 'consistencyToken-1090516718'; - const expectedResponse = { - consistencyToken, - }; - - // Mock Grpc layer - client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.generateConsistencyToken(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes generateConsistencyToken with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.generateConsistencyToken(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('checkConsistency', () => { - it('invokes checkConsistency without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const consistencyToken = 'consistencyToken-1090516718'; - const request = { - name: formattedName, - consistencyToken, - }; - - // Mock response - const consistent = true; - const expectedResponse = { - consistent, - }; - - // Mock Grpc layer - client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.checkConsistency(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes checkConsistency with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const consistencyToken = 'consistencyToken-1090516718'; - const request = { - name: formattedName, - consistencyToken, - }; - - // Mock Grpc layer - client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.checkConsistency(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('snapshotTable', function() { - it('invokes snapshotTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const cluster = 'cluster872092154'; - const snapshotId = 'snapshotId-168585866'; - const description = 'description-1724546052'; - const request = { - name: formattedName, - cluster, - snapshotId, - description, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const dataSizeBytes = 2110122398; - const description2 = 'description2568623279'; - const expectedResponse = { - name: name2, - dataSizeBytes, - description: description2, - }; - - // Mock Grpc layer - client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .snapshotTable(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes snapshotTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const cluster = 'cluster872092154'; - const snapshotId = 'snapshotId-168585866'; - const description = 'description-1724546052'; - const request = { - name: formattedName, - cluster, - snapshotId, - description, - }; - - // Mock Grpc layer - client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .snapshotTable(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.snapshotTable.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.snapshotTable.metadataDecoder instanceof - Function - ); - }); - }); - - describe('getSnapshot', () => { - it('invokes getSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const dataSizeBytes = 2110122398; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - dataSizeBytes, - description, - }; - - // Mock Grpc layer - client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSnapshot(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSnapshot(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listSnapshots', () => { - it('invokes listSnapshots without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const snapshotsElement = {}; - const snapshots = [snapshotsElement]; - const expectedResponse = { - nextPageToken, - snapshots, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.snapshots); - }; - - client.listSnapshots(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.snapshots); - done(); - }); - }); - - it('invokes listSnapshots with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSnapshots(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteSnapshot', () => { - it('invokes deleteSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod(request); - - client.deleteSnapshot(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteSnapshot(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response?, error?) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error?) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/test/gapic-v2.js b/test/gapic-v2.js deleted file mode 100644 index 763b0b491..000000000 --- a/test/gapic-v2.js +++ /dev/null @@ -1,2680 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const adminModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('BigtableInstanceAdminClient', () => { - it('has servicePath', () => { - const servicePath = adminModule.v2.BigtableInstanceAdminClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = adminModule.v2.BigtableInstanceAdminClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = adminModule.v2.BigtableInstanceAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - fallback: true, - }); - assert(client); - }); - - describe('createInstance', function() { - it('invokes createInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const instanceId = 'instanceId-2101995259'; - const instance = {}; - const clusters = {}; - const request = { - parent: formattedParent, - instanceId: instanceId, - instance: instance, - clusters: clusters, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const instanceId = 'instanceId-2101995259'; - const instance = {}; - const clusters = {}; - const request = { - parent: formattedParent, - instanceId: instanceId, - instance: instance, - clusters: clusters, - }; - - // Mock Grpc layer - client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createInstance - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.createInstance - .metadataDecoder instanceof Function - ); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getInstance = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getInstance(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getInstance(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = 'nextPageToken-1530815211'; - const expectedResponse = { - nextPageToken: nextPageToken, - }; - - // Mock Grpc layer - client._innerApiCalls.listInstances = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listInstances(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listInstances with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listInstances = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listInstances(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const displayName = 'displayName1615086568'; - const type = 'TYPE_UNSPECIFIED'; - const labels = {}; - const request = { - name: formattedName, - displayName: displayName, - type: type, - labels: labels, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName2 = 'displayName21615000987'; - const expectedResponse = { - name: name2, - displayName: displayName2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateInstance(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const displayName = 'displayName1615086568'; - const type = 'TYPE_UNSPECIFIED'; - const labels = {}; - const request = { - name: formattedName, - displayName: displayName, - type: type, - labels: labels, - }; - - // Mock Grpc layer - client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateInstance(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('partialUpdateInstance', function() { - it('invokes partialUpdateInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const instance = {}; - const updateMask = {}; - const request = { - instance: instance, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .partialUpdateInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes partialUpdateInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const instance = {}; - const updateMask = {}; - const request = { - instance: instance, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .partialUpdateInstance(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.partialUpdateInstance - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.partialUpdateInstance - .metadataDecoder instanceof Function - ); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod(request); - - client.deleteInstance(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteInstance with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteInstance(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('createCluster', function() { - it('invokes createCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const clusterId = 'clusterId240280960'; - const cluster = {}; - const request = { - parent: formattedParent, - clusterId: clusterId, - cluster: cluster, - }; - - // Mock response - const name = 'name3373707'; - const location = 'location1901043637'; - const serveNodes = 1288838783; - const expectedResponse = { - name: name, - location: location, - serveNodes: serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const clusterId = 'clusterId240280960'; - const cluster = {}; - const request = { - parent: formattedParent, - clusterId: clusterId, - cluster: cluster, - }; - - // Mock Grpc layer - client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createCluster.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.createCluster.metadataDecoder instanceof - Function - ); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const location = 'location1901043637'; - const serveNodes = 1288838783; - const expectedResponse = { - name: name2, - location: location, - serveNodes: serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.getCluster = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getCluster(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getCluster(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = 'nextPageToken-1530815211'; - const expectedResponse = { - nextPageToken: nextPageToken, - }; - - // Mock Grpc layer - client._innerApiCalls.listClusters = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listClusters(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listClusters with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listClusters = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listClusters(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateCluster', function() { - it('invokes updateCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const serveNodes = 1288838783; - const request = { - name: formattedName, - serveNodes: serveNodes, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const location = 'location1901043637'; - const serveNodes2 = 1623486220; - const expectedResponse = { - name: name2, - location: location, - serveNodes: serveNodes2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .updateCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes updateCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const serveNodes = 1288838783; - const request = { - name: formattedName, - serveNodes: serveNodes, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .updateCluster(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.updateCluster.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.updateCluster.metadataDecoder instanceof - Function - ); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod(request); - - client.deleteCluster(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteCluster with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteCluster(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('createAppProfile', () => { - it('invokes createAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const appProfileId = 'appProfileId1262094415'; - const appProfile = {}; - const request = { - parent: formattedParent, - appProfileId: appProfileId, - appProfile: appProfile, - }; - - // Mock response - const name = 'name3373707'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - etag: etag, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createAppProfile(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const appProfileId = 'appProfileId1262094415'; - const appProfile = {}; - const request = { - parent: formattedParent, - appProfileId: appProfileId, - appProfile: appProfile, - }; - - // Mock Grpc layer - client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createAppProfile(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getAppProfile', () => { - it('invokes getAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - etag: etag, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getAppProfile(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getAppProfile(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listAppProfiles', () => { - it('invokes listAppProfiles without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const appProfilesElement = {}; - const appProfiles = [appProfilesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - appProfiles: appProfiles, - }; - - // Mock Grpc layer - client._innerApiCalls.listAppProfiles = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.appProfiles); - }; - - client.listAppProfiles(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.appProfiles); - done(); - }); - }); - - it('invokes listAppProfiles with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listAppProfiles = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listAppProfiles(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateAppProfile', function() { - it('invokes updateAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const appProfile = {}; - const updateMask = {}; - const request = { - appProfile: appProfile, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const etag = 'etag3123477'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - etag: etag, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .updateAppProfile(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes updateAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const appProfile = {}; - const updateMask = {}; - const request = { - appProfile: appProfile, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .updateAppProfile(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.updateAppProfile - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.updateAppProfile - .metadataDecoder instanceof Function - ); - }); - }); - - describe('deleteAppProfile', () => { - it('invokes deleteAppProfile without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const ignoreWarnings = true; - const request = { - name: formattedName, - ignoreWarnings: ignoreWarnings, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod(request); - - client.deleteAppProfile(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteAppProfile with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.appProfilePath( - '[PROJECT]', - '[INSTANCE]', - '[APP_PROFILE]' - ); - const ignoreWarnings = true; - const request = { - name: formattedName, - ignoreWarnings: ignoreWarnings, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteAppProfile(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new adminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('BigtableTableAdminClient', () => { - it('has servicePath', () => { - const servicePath = adminModule.v2.BigtableTableAdminClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = adminModule.v2.BigtableTableAdminClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = adminModule.v2.BigtableTableAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new adminModule.v2.BigtableTableAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new adminModule.v2.BigtableTableAdminClient({ - fallback: true, - }); - assert(client); - }); - - describe('createTable', () => { - it('invokes createTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const table = {}; - const request = { - parent: formattedParent, - tableId: tableId, - table: table, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createTable = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createTable(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const table = {}; - const request = { - parent: formattedParent, - tableId: tableId, - table: table, - }; - - // Mock Grpc layer - client._innerApiCalls.createTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createTable(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createTableFromSnapshot', function() { - it('invokes createTableFromSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const sourceSnapshot = 'sourceSnapshot-947679896'; - const request = { - parent: formattedParent, - tableId: tableId, - sourceSnapshot: sourceSnapshot, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createTableFromSnapshot(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createTableFromSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const tableId = 'tableId-895419604'; - const sourceSnapshot = 'sourceSnapshot-947679896'; - const request = { - parent: formattedParent, - tableId: tableId, - sourceSnapshot: sourceSnapshot, - }; - - // Mock Grpc layer - client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createTableFromSnapshot(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createTableFromSnapshot - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.createTableFromSnapshot - .metadataDecoder instanceof Function - ); - }); - }); - - describe('listTables', () => { - it('invokes listTables without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const tablesElement = {}; - const tables = [tablesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - tables: tables, - }; - - // Mock Grpc layer - client._innerApiCalls.listTables = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.tables); - }; - - client.listTables(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.tables); - done(); - }); - }); - - it('invokes listTables with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listTables = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listTables(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getTable', () => { - it('invokes getTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getTable = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getTable(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getTable(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteTable', () => { - it('invokes deleteTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTable = mockSimpleGrpcMethod(request); - - client.deleteTable(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTable = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteTable(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('modifyColumnFamilies', () => { - it('invokes modifyColumnFamilies without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const modifications = []; - const request = { - name: formattedName, - modifications: modifications, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.modifyColumnFamilies(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes modifyColumnFamilies with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const modifications = []; - const request = { - name: formattedName, - modifications: modifications, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.modifyColumnFamilies(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('dropRowRange', () => { - it('invokes dropRowRange without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod(request); - - client.dropRowRange(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes dropRowRange with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.dropRowRange(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('generateConsistencyToken', () => { - it('invokes generateConsistencyToken without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const consistencyToken = 'consistencyToken-1090516718'; - const expectedResponse = { - consistencyToken: consistencyToken, - }; - - // Mock Grpc layer - client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.generateConsistencyToken(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes generateConsistencyToken with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.generateConsistencyToken(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('checkConsistency', () => { - it('invokes checkConsistency without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const consistencyToken = 'consistencyToken-1090516718'; - const request = { - name: formattedName, - consistencyToken: consistencyToken, - }; - - // Mock response - const consistent = true; - const expectedResponse = { - consistent: consistent, - }; - - // Mock Grpc layer - client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.checkConsistency(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes checkConsistency with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const consistencyToken = 'consistencyToken-1090516718'; - const request = { - name: formattedName, - consistencyToken: consistencyToken, - }; - - // Mock Grpc layer - client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.checkConsistency(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = 'etag3123477'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('snapshotTable', function() { - it('invokes snapshotTable without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const cluster = 'cluster872092154'; - const snapshotId = 'snapshotId-168585866'; - const description = 'description-1724546052'; - const request = { - name: formattedName, - cluster: cluster, - snapshotId: snapshotId, - description: description, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const dataSizeBytes = 2110122398; - const description2 = 'description2568623279'; - const expectedResponse = { - name: name2, - dataSizeBytes: dataSizeBytes, - description: description2, - }; - - // Mock Grpc layer - client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .snapshotTable(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes snapshotTable with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.tablePath( - '[PROJECT]', - '[INSTANCE]', - '[TABLE]' - ); - const cluster = 'cluster872092154'; - const snapshotId = 'snapshotId-168585866'; - const description = 'description-1724546052'; - const request = { - name: formattedName, - cluster: cluster, - snapshotId: snapshotId, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .snapshotTable(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.snapshotTable.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.snapshotTable.metadataDecoder instanceof - Function - ); - }); - }); - - describe('getSnapshot', () => { - it('invokes getSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const dataSizeBytes = 2110122398; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - dataSizeBytes: dataSizeBytes, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSnapshot(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSnapshot(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listSnapshots', () => { - it('invokes listSnapshots without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const snapshotsElement = {}; - const snapshots = [snapshotsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - snapshots: snapshots, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.snapshots); - }; - - client.listSnapshots(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.snapshots); - done(); - }); - }); - - it('invokes listSnapshots with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.clusterPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]' - ); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSnapshots(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteSnapshot', () => { - it('invokes deleteSnapshot without error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod(request); - - client.deleteSnapshot(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteSnapshot with error', done => { - const client = new adminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath( - '[PROJECT]', - '[INSTANCE]', - '[CLUSTER]', - '[SNAPSHOT]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteSnapshot(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/tsconfig.json b/tsconfig.json index f39b8a518..c70f982ec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,12 @@ "compilerOptions": { "rootDir": ".", "outDir": "build", - "noImplicitAny": false + "noImplicitAny": false, + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] }, "include": [ "src/*.ts", diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..cc69c5731 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: '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', +};